Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] urfave/cli command completion for fish #771

Open
dsluo opened this issue Nov 13, 2024 · 1 comment
Open

[Feature Request] urfave/cli command completion for fish #771

dsluo opened this issue Nov 13, 2024 · 1 comment

Comments

@dsluo
Copy link

dsluo commented Nov 13, 2024

urfave/cli seems to support command completion for fish since version 1.22.0. I'd be great to have this enabled.

@kucukaslan
Copy link
Contributor

I missed it.
It seems fish's autocompletions need to be precomputed. So it might be trickier to support bucket name and key completions.

BTW when I tried called App.ToFishCompletion() I got:

function __fish_s5cmd_no_subcommand --description 'Test if there has been any subcommand yet'
    for i in (commandline -opc)
        if contains -- $i ls cp rm mv mb rb select csv json parquet du cat pipe run sync version bucket-version presign head
            return 1
        end
    end
    return 0
end

complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l json -d 'enable JSON formatted output'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l numworkers -r -d 'number of workers execute operation on each object'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l retry-count -s r -r -d 'number of times that a request will be retried for failures'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l endpoint-url -r -d 'override default S3 host for custom services'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l no-verify-ssl -d 'disable SSL certificate verification'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l log -r -d 'log level: (trace, debug, info, error)'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l install-completion -d 'get completion installation instructions for your shell (only available for bash, pwsh, and zsh)'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l dry-run -d 'fake run; show what commands will be executed without actually executing them'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l stat -d 'collect statistics of program execution and display it at the end'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l no-sign-request -d 'do not sign requests: credentials will not be loaded if --no-sign-request is provided'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l use-list-objects-v1 -d 'use ListObjectsV1 API for services that don\'t support ListObjectsV2'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l request-payer -r -d 'who pays for request (access requester pays buckets)'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l profile -r -d 'use the specified profile from the credentials file'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l credentials-file -r -d 'use the specified credentials file instead of the default credentials file'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l help -s h -d 'show help'
complete -c s5cmd -n '__fish_s5cmd_no_subcommand' -f -l version -s v -d 'print the version'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'ls' -d 'list buckets and objects'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l etag -s e -d 'show entity tag (ETag) in the output'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l humanize -s H -d 'human-readable output for object sizes'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l storage-class -s s -d 'display full name of the object class'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from ls' -f -l show-fullpath -d 'shows only the fullpath names of the object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'cp' -d 'copy objects'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l flatten -s f -d 'flatten directory structure of source, starting from the first wildcard'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l no-clobber -s n -d 'do not overwrite destination if already exists'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l if-size-differ -s s -d 'only overwrite destination if size differs'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l if-source-newer -s u -d 'only overwrite destination if source modtime is newer'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l show-progress -s sp -d 'show a progress bar'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l no-follow-symlinks -d 'do not follow symbolic links'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l storage-class -r -d 'set storage class for target (\'STANDARD\',\'REDUCED_REDUNDANCY\',\'GLACIER\',\'STANDARD_IA\',\'ONEZONE_IA\',\'INTELLIGENT_TIERING\',\'DEEP_ARCHIVE\')'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l concurrency -s c -r -d 'number of concurrent parts transferred between host and remote server'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l part-size -s p -r -d 'size of each part transferred between host and remote server, in MiB'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l metadata -r -d 'set arbitrary metadata for the object, e.g. --metadata \'foo=bar\' --metadata \'fizz=buzz\''
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l metadata-directive -r -d 'set metadata directive for the object: COPY or REPLACE'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l sse -r -d 'perform server side encryption of the data at its destination, e.g. aws:kms'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l sse-kms-key-id -r -d 'customer master key (CMK) id for SSE-KMS encryption; leave it out if server-side generated key is desired'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l acl -r -d 'set acl for target: defines granted accesses and their types on different accounts/groups, e.g. cp --acl \'public-read\''
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l cache-control -r -d 'set cache control for target: defines cache control header for object, e.g. cp --cache-control \'public, max-age=345600\''
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l expires -r -d 'set expires for target (uses RFC3339 format): defines expires header for object, e.g. cp  --expires \'2024-10-01T20:30:00Z\''
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during copying, downloading and moving glacier objects'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l source-region -r -d 'set the region of source bucket; the region of the source bucket will be automatically discovered if --source-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l destination-region -r -d 'set the region of destination bucket: the region of the destination bucket will be automatically discovered if --destination-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l include -r -d 'include objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l content-type -r -d 'set content type for target: defines content type header for object, e.g. --content-type text/plain'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l content-encoding -r -d 'set content encoding for target: defines content encoding header for object, e.g. --content-encoding gzip'
complete -c s5cmd -n '__fish_seen_subcommand_from cp' -f -l content-disposition -r -d 'set content disposition for target: defines content disposition header for object, e.g. --content-disposition \'attachment; filename="filename.jpg"\''
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'rm' -d 'remove objects'
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l include -r -d 'include objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from rm' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'mv' -d 'move/rename objects'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l flatten -s f -d 'flatten directory structure of source, starting from the first wildcard'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l no-clobber -s n -d 'do not overwrite destination if already exists'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l if-size-differ -s s -d 'only overwrite destination if size differs'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l if-source-newer -s u -d 'only overwrite destination if source modtime is newer'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l show-progress -s sp -d 'show a progress bar'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l no-follow-symlinks -d 'do not follow symbolic links'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l storage-class -r -d 'set storage class for target (\'STANDARD\',\'REDUCED_REDUNDANCY\',\'GLACIER\',\'STANDARD_IA\',\'ONEZONE_IA\',\'INTELLIGENT_TIERING\',\'DEEP_ARCHIVE\')'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l concurrency -s c -r -d 'number of concurrent parts transferred between host and remote server'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l part-size -s p -r -d 'size of each part transferred between host and remote server, in MiB'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l metadata -r -d 'set arbitrary metadata for the object, e.g. --metadata \'foo=bar\' --metadata \'fizz=buzz\''
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l metadata-directive -r -d 'set metadata directive for the object: COPY or REPLACE'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l sse -r -d 'perform server side encryption of the data at its destination, e.g. aws:kms'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l sse-kms-key-id -r -d 'customer master key (CMK) id for SSE-KMS encryption; leave it out if server-side generated key is desired'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l acl -r -d 'set acl for target: defines granted accesses and their types on different accounts/groups, e.g. cp --acl \'public-read\''
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l cache-control -r -d 'set cache control for target: defines cache control header for object, e.g. cp --cache-control \'public, max-age=345600\''
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l expires -r -d 'set expires for target (uses RFC3339 format): defines expires header for object, e.g. cp  --expires \'2024-10-01T20:30:00Z\''
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during copying, downloading and moving glacier objects'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l source-region -r -d 'set the region of source bucket; the region of the source bucket will be automatically discovered if --source-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l destination-region -r -d 'set the region of destination bucket: the region of the destination bucket will be automatically discovered if --destination-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l include -r -d 'include objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l content-type -r -d 'set content type for target: defines content type header for object, e.g. --content-type text/plain'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l content-encoding -r -d 'set content encoding for target: defines content encoding header for object, e.g. --content-encoding gzip'
complete -c s5cmd -n '__fish_seen_subcommand_from mv' -f -l content-disposition -r -d 'set content disposition for target: defines content disposition header for object, e.g. --content-disposition \'attachment; filename="filename.jpg"\''
complete -c s5cmd -n '__fish_seen_subcommand_from mb' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'mb' -d 'make bucket'
complete -c s5cmd -n '__fish_seen_subcommand_from rb' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'rb' -d 'remove bucket'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'select' -d 'run SQL queries on objects'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l compression -r -d 'input compression format (options for AWS: GZIP or BZIP2)'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l query -s e -r -d 'SQL expression to use to select from the objects'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l output-format -r -d 'output format of the result (options: json, csv)'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during selecting objects'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from select' -f -l version-id -r -d 'use the specified version of the object'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_seen_subcommand_from select' -a 'csv' -d 'run queries on csv files'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l delimiter -r -d 'delimiter of the csv file.'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l use-header -r -d 'use header of the csv file. (options for AWS: IGNORE, NONE, USE)'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l compression -r -d 'input compression format (options for AWS: GZIP or BZIP2)'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l query -s e -r -d 'SQL expression to use to select from the objects'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l output-format -r -d 'output format of the result (options: json, csv)'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during selecting objects'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from csv' -f -l version-id -r -d 'use the specified version of the object'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_seen_subcommand_from select' -a 'json' -d 'run queries on json files'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l structure -r -d 'how objects are aligned in the json file, options:(lines, document)'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l compression -r -d 'input compression format (options for AWS: GZIP or BZIP2)'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l query -s e -r -d 'SQL expression to use to select from the objects'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l output-format -r -d 'output format of the result (options: json, csv)'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during selecting objects'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from json' -f -l version-id -r -d 'use the specified version of the object'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_seen_subcommand_from select' -a 'parquet' -d 'run queries on parquet files'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l query -s e -r -d 'SQL expression to use to select from the objects'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l output-format -r -d 'output format of the result (options: json, csv)'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during selecting objects'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from parquet' -f -l version-id -r -d 'use the specified version of the object'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'du' -d 'show object size usage'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l group -s g -d 'group sizes by storage class'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l humanize -s H -d 'human-readable output for object sizes'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l all-versions -d 'list all versions of object(s)'
complete -c s5cmd -n '__fish_seen_subcommand_from du' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from cat' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'cat' -d 'print remote object content'
complete -c s5cmd -n '__fish_seen_subcommand_from cat' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from cat' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from cat' -f -l concurrency -s c -r -d 'number of concurrent parts transferred between host and remote server'
complete -c s5cmd -n '__fish_seen_subcommand_from cat' -f -l part-size -s p -r -d 'size of each part transferred between host and remote server, in MiB'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'pipe' -d 'stream to remote from stdin'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l storage-class -r -d 'set storage class for target (\'STANDARD\',\'REDUCED_REDUNDANCY\',\'GLACIER\',\'STANDARD_IA\',\'ONEZONE_IA\',\'INTELLIGENT_TIERING\',\'DEEP_ARCHIVE\')'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l concurrency -s c -r -d 'number of concurrent parts transferred between host and remote server'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l part-size -s p -r -d 'size of each part transferred between host and remote server, in MiB'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l metadata -r -d 'set arbitrary metadata for the object'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l sse -r -d 'perform server side encryption of the data at its destination, e.g. aws:kms'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l sse-kms-key-id -r -d 'customer master key (CMK) id for SSE-KMS encryption; leave it out if server-side generated key is desired'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l acl -r -d 'set acl for target: defines granted accesses and their types on different accounts/groups, e.g. pipe --acl \'public-read\''
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l cache-control -r -d 'set cache control for target: defines cache control header for object, e.g. pipe --cache-control \'public, max-age=345600\''
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l expires -r -d 'set expires for target (uses RFC3339 format): defines expires header for object, e.g. pipe  --expires \'2024-10-01T20:30:00Z\''
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l content-type -r -d 'set content type for target: defines content type header for object, e.g. --content-type text/plain'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l content-encoding -r -d 'set content encoding for target: defines content encoding header for object, e.g. --content-encoding gzip'
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l content-disposition -r -d 'set content disposition for target: defines content disposition header for object, e.g. --content-disposition \'attachment; filename="filename.jpg"\''
complete -c s5cmd -n '__fish_seen_subcommand_from pipe' -f -l no-clobber -s n -d 'do not overwrite destination if already exists'
complete -c s5cmd -n '__fish_seen_subcommand_from run' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'run' -d 'run commands in batch'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'sync' -d 'sync objects'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l delete -d 'delete objects in destination but not in source'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l size-only -d 'make size of object only criteria to decide whether an object should be synced'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l exit-on-error -d 'stops the sync process if an error is received'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l no-follow-symlinks -d 'do not follow symbolic links'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l storage-class -r -d 'set storage class for target (\'STANDARD\',\'REDUCED_REDUNDANCY\',\'GLACIER\',\'STANDARD_IA\',\'ONEZONE_IA\',\'INTELLIGENT_TIERING\',\'DEEP_ARCHIVE\')'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l concurrency -s c -r -d 'number of concurrent parts transferred between host and remote server'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l part-size -s p -r -d 'size of each part transferred between host and remote server, in MiB'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l metadata -r -d 'set arbitrary metadata for the object, e.g. --metadata \'foo=bar\' --metadata \'fizz=buzz\''
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l metadata-directive -r -d 'set metadata directive for the object: COPY or REPLACE'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l sse -r -d 'perform server side encryption of the data at its destination, e.g. aws:kms'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l sse-kms-key-id -r -d 'customer master key (CMK) id for SSE-KMS encryption; leave it out if server-side generated key is desired'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l acl -r -d 'set acl for target: defines granted accesses and their types on different accounts/groups, e.g. cp --acl \'public-read\''
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l cache-control -r -d 'set cache control for target: defines cache control header for object, e.g. cp --cache-control \'public, max-age=345600\''
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l expires -r -d 'set expires for target (uses RFC3339 format): defines expires header for object, e.g. cp  --expires \'2024-10-01T20:30:00Z\''
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l force-glacier-transfer -d 'force transfer of glacier objects whether they are restored or not'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l ignore-glacier-warnings -d 'turns off glacier warnings: ignore errors encountered during copying, downloading and moving glacier objects'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l source-region -r -d 'set the region of source bucket; the region of the source bucket will be automatically discovered if --source-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l destination-region -r -d 'set the region of destination bucket: the region of the destination bucket will be automatically discovered if --destination-region is not specified'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l exclude -r -d 'exclude objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l include -r -d 'include objects with given pattern'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l content-type -r -d 'set content type for target: defines content type header for object, e.g. --content-type text/plain'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l content-encoding -r -d 'set content encoding for target: defines content encoding header for object, e.g. --content-encoding gzip'
complete -c s5cmd -n '__fish_seen_subcommand_from sync' -f -l content-disposition -r -d 'set content disposition for target: defines content disposition header for object, e.g. --content-disposition \'attachment; filename="filename.jpg"\''
complete -c s5cmd -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'version' -d 'print version'
complete -c s5cmd -n '__fish_seen_subcommand_from bucket-version' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'bucket-version' -d 'configure bucket versioning'
complete -c s5cmd -n '__fish_seen_subcommand_from bucket-version' -f -l set -r -d 'set versioning status of bucket: (Suspended, Enabled)'
complete -c s5cmd -n '__fish_seen_subcommand_from presign' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'presign' -d 'print remote object presign url'
complete -c s5cmd -n '__fish_seen_subcommand_from presign' -f -l expire -r -d 'url valid duration'
complete -c s5cmd -n '__fish_seen_subcommand_from presign' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from head' -f -l help -s h -d 'show help'
complete -r -c s5cmd -n '__fish_s5cmd_no_subcommand' -a 'head' -d 'print remote object metadata'
complete -c s5cmd -n '__fish_seen_subcommand_from head' -f -l version-id -r -d 'use the specified version of an object'
complete -c s5cmd -n '__fish_seen_subcommand_from head' -f -l raw -d 'disable the wildcard operations, useful with filenames that contains glob characters'

you may try "writing that to the fish complete".

ps. Adding fish to existing autocompletion flag may require a trick since it needs a reference to app to prepare completion string in runtime which printAutocompletionInstructions cannot access. To avoid impacting all executions one would need to expose/delegate that call to another function wrapper and call that in printAutocompletionInstructions

	fishfn = app.ToFishCompletion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants