Add completions for cargo-asm

This commit is contained in:
Mahmoud Al-Qudsi 2024-05-17 12:01:30 -05:00
parent f4a79cc138
commit 0271d91d3a

View file

@ -814,3 +814,31 @@ complete -c cargo -n "__fish_seen_subcommand_from help" -s v -l verbose -d 'Use
complete -c cargo -n "__fish_seen_subcommand_from help" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from help" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from help" -l offline -d 'Run without accessing the network'
# Add completions for popular cargo addon `cargo-asm` (that at least one fish dev uses)
if command -q cargo-asm
# Flags (no parameters)
complete -c cargo -n "__fish_seen_subcommand_from asm" -l comments -d "Print asm comments"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l debug-info -d "Generate asm w/ debug info even if not required"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l debug-mode -d "Print output useful for debugging"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l directives -d "Print asm directives"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l help -s h -d "Print cargo-asm help info"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l json -d "Serialize asm AST to JSON"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l lib -d "Build only the lib target"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l no-color -d "Disable color output"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l no-default-features -d "Disable all cargo features on build"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l rust -d "Interleave asm output w/ rust code"
complete -c cargo -n "__fish_seen_subcommand_from asm" -l version -s V -d "Print cargo-asm version info"
# Options (require a parameter)
complete -c cargo -n "__fish_seen_subcommand_from asm" -rl target -d "Build for target"
complete -c cargo -n "__fish_seen_subcommand_from asm" -rl asm-style -d "ASM style (default: intel)" -xa "intel att"
complete -c cargo -n "__fish_seen_subcommand_from asm" -rl build-type -d "Build type (default: release)" -xa "debug release"
complete -c cargo -n "__fish_seen_subcommand_from asm" -rl features -d "Cargo features to enable"
complete -c cargo -n "__fish_seen_subcommand_from asm" -rl manifest-path -d "Run cargo-asm in a different directory"
# Dynamically generate completions for the function/impl path to translate to asm (the reason these completions exist)
complete -c cargo -n "__fish_seen_subcommand_from asm" -xa "(cargo asm)"
# TODO: dynamically generate completions for --features and --target
end