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

error: the following arguments are required: command #982

Closed
nichoth opened this issue Jan 1, 2024 · 5 comments
Closed

error: the following arguments are required: command #982

nichoth opened this issue Jan 1, 2024 · 5 comments
Labels

Comments

@nichoth
Copy link

nichoth commented Jan 1, 2024

See instructions page

OS info: MacBook Air (M1, 2020)

  1. install b2 — brew install b2-tools
  2. type b2, see the following error
/opt/homebrew/bin/b2 [-h] [--help-all]
                     {authorize-account,authorize_account,cancel-all-unfinished-large-files,cancel_all_unfinished_large_files,cancel-large-file,cancel_large_file,clear-account,clear_account,copy-file-by-id,copy_file_by_id,create-bucket,create_bucket,create-key,create_key,delete-bucket,delete_bucket,delete-file-version,delete_file_version,delete-key,delete_key,download-file,download_file,download-file-by-id,download_file_by_id,download-file-by-name,download_file_by_name,cat,get-account-info,get_account_info,get-bucket,get_bucket,file-info,file_info,get-file-info,get_file_info,get-download-auth,get_download_auth,get-download-url-with-auth,get_download_url_with_auth,hide-file,hide_file,list-buckets,list_buckets,list-keys,list_keys,list-parts,list_parts,list-unfinished-large-files,list_unfinished_large_files,ls,rm,get-url,get_url,make-url,make_url,make-friendly-url,make_friendly_url,sync,update-bucket,update_bucket,upload-file,upload_file,upload-unbound-stream,upload_unbound_stream,update-file-legal-hold,update_file_legal_hold,update-file-retention,update_file_retention,replication-setup,replication_setup,replication-delete,replication_delete,replication-pause,replication_pause,replication-unpause,replication_unpause,replication-status,replication_status,version,license,install-autocomplete,install_autocomplete}
                     ...

  This program provides command-line access to the B2 service.

  There are two flows of authorization:

    • call b2 authorize-account and have the credentials cached in sqlite
    • set B2_APPLICATION_KEY_ID and B2_APPLICATION_KEY environment variables
    when running this program

  This program caches authentication-related and other data in a local SQLite
  database. The location of this database is determined in the following way:

  If --profile arg is provided:

    • XDG_CONFIG_HOME/b2/db-<profile>.sqlite, if XDG_CONFIG_HOME env var is set
    • ~/.b2db-{profile}.sqlite

  Otherwise:

    • B2_ACCOUNT_INFO env var's value, if set
    • ~/.b2_account_info, if it exists
    • XDG_CONFIG_HOME/b2/account_info, if XDG_CONFIG_HOME env var is set
    • ~/.b2_account_info, as default

  If the directory XDG_CONFIG_HOME/b2 does not exist (and is needed), it is
  created. Please note that the above rules may be changed in next versions of
  b2sdk, and in order to get reliable authentication file location you should
  use b2 get-account-info.

  You can suppress command stdout & stderr output by using --quiet option. To
  supress only progress bar, use --noProgress option.

  For more details on one command:

  b2 <command> --help

  When authorizing with application keys, this tool requires that the key have
  the listBuckets capability so that it can take the bucket names you provide
  on the command line and translate them into bucket IDs for the B2 Storage
  service. Each different command may required additional capabilities. You
  can find the details for each command in the help for that command.

  A string provided via an optional environment variable B2_USER_AGENT_APPEND
  will be appended to the User-Agent.

options:
  -h, --help  show this help message and exit
  --help-all  show help for all options, including deprecated ones

usages:
  /opt/homebrew/bin/b2 authorize-account [-h]
                                         [applicationKeyId] [applicationKey]
  /opt/homebrew/bin/b2 cancel-all-unfinished-large-files [-h] bucketName
  /opt/homebrew/bin/b2 cancel-large-file [-h] fileId
  /opt/homebrew/bin/b2 clear-account [-h]
  /opt/homebrew/bin/b2 copy-file-by-id [-h] [--fetchMetadata]
                                       [--contentType CONTENTTYPE]
                                       [--range RANGE] [--info INFO | --noInfo]
                                       [--cache-control CACHE_CONTROL]
                                       [--content-disposition CONTENT_DISPOSITION]
                                       [--content-encoding CONTENT_ENCODING]
                                       [--content-language CONTENT_LANGUAGE]
                                       [--expires EXPIRES]
                                       [--destinationServerSideEncryption {SSE-B2,SSE-C}]
                                       [--destinationServerSideEncryptionAlgorithm {AES256}]
                                       [--sourceServerSideEncryption {SSE-C}]
                                       [--sourceServerSideEncryptionAlgorithm {AES256}]
                                       [--fileRetentionMode {compliance,governance}]
                                       [--retainUntil TIMESTAMP]
                                       [--legalHold {on,off}]
                                       sourceFileId destinationBucketName
                                       b2FileName
  /opt/homebrew/bin/b2 create-bucket [-h] [--bucketInfo BUCKETINFO]
                                     [--corsRules CORSRULES] [--fileLockEnabled]
                                     [--replication REPLICATION]
                                     [--defaultServerSideEncryption {SSE-B2,none}]
                                     [--defaultServerSideEncryptionAlgorithm {AES256}]
                                     [--lifecycleRule LIFECYCLERULES | --lifecycleRules LIFECYCLERULES]
                                     bucketName {allPublic,allPrivate}
  /opt/homebrew/bin/b2 create-key [-h] [--bucket BUCKET]
                                  [--namePrefix NAMEPREFIX]
                                  [--duration DURATION] [--allCapabilities]
                                  keyName [capabilities]
  /opt/homebrew/bin/b2 delete-bucket [-h] bucketName
  /opt/homebrew/bin/b2 delete-file-version [-h] [--bypassGovernance]
                                           [fileName] fileId
  /opt/homebrew/bin/b2 delete-key [-h] applicationKeyId
  /opt/homebrew/bin/b2 download-file [-h] [--threads THREADS]
                                     [--max-download-streams-per-file MAX_DOWNLOAD_STREAMS_PER_FILE]
                                     [--noProgress]
                                     [--sourceServerSideEncryption {SSE-C}]
                                     [--sourceServerSideEncryptionAlgorithm {AES256}]
                                     [--write-buffer-size BYTES]
                                     [--skip-hash-verification]
                                     B2_URI localFileName
  /opt/homebrew/bin/b2 cat [-h] [--noProgress]
                           [--sourceServerSideEncryption {SSE-C}]
                           [--sourceServerSideEncryptionAlgorithm {AES256}]
                           [--write-buffer-size BYTES]
                           [--skip-hash-verification]
                           B2_URI
  /opt/homebrew/bin/b2 get-account-info [-h]
  /opt/homebrew/bin/b2 get-bucket [-h] [--showSize] bucketName
  /opt/homebrew/bin/b2 file-info [-h] B2_URI
  /opt/homebrew/bin/b2 get-download-auth [-h] [--prefix PREFIX]
                                         [--duration DURATION]
                                         bucketName
  /opt/homebrew/bin/b2 get-download-url-with-auth [-h] [--duration DURATION]
                                                  bucketName fileName
  /opt/homebrew/bin/b2 hide-file [-h] bucketName fileName
  /opt/homebrew/bin/b2 list-buckets [-h] [--json]
  /opt/homebrew/bin/b2 list-keys [-h] [--long]
  /opt/homebrew/bin/b2 list-parts [-h] largeFileId
  /opt/homebrew/bin/b2 list-unfinished-large-files [-h] bucketName
  /opt/homebrew/bin/b2 ls [-h] [--long] [--json] [--replication] [--versions]
                          [-r] [--withWildcard]
                          bucketName [folderName]
  /opt/homebrew/bin/b2 rm [-h] [--dryRun] [--queueSize QUEUESIZE] [--noProgress]
                          [--failFast] [--threads THREADS] [--versions] [-r]
                          [--withWildcard]
                          bucketName [folderName]
  /opt/homebrew/bin/b2 get-url [-h] B2_URI
  /opt/homebrew/bin/b2 sync [-h] [--noProgress] [--dryRun] [--allowEmptySource]
                            [--excludeAllSymlinks] [--syncThreads SYNCTHREADS]
                            [--downloadThreads DOWNLOADTHREADS]
                            [--uploadThreads UPLOADTHREADS]
                            [--compareVersions {none,modTime,size}]
                            [--compareThreshold MILLIS] [--excludeRegex REGEX]
                            [--includeRegex REGEX] [--excludeDirRegex REGEX]
                            [--excludeIfModifiedAfter TIMESTAMP]
                            [--threads THREADS]
                            [--destinationServerSideEncryption {SSE-B2,SSE-C}]
                            [--destinationServerSideEncryptionAlgorithm {AES256}]
                            [--sourceServerSideEncryption {SSE-C}]
                            [--sourceServerSideEncryptionAlgorithm {AES256}]
                            [--write-buffer-size BYTES]
                            [--skip-hash-verification]
                            [--max-download-streams-per-file MAX_DOWNLOAD_STREAMS_PER_FILE]
                            [--incrementalMode] [--skipNewer | --replaceNewer]
                            [--delete | --keepDays DAYS]
                            source destination
  /opt/homebrew/bin/b2 update-bucket [-h] [--bucketInfo BUCKETINFO]
                                     [--corsRules CORSRULES]
                                     [--defaultRetentionMode {compliance,governance,none}]
                                     [--defaultRetentionPeriod period]
                                     [--replication REPLICATION]
                                     [--fileLockEnabled]
                                     [--defaultServerSideEncryption {SSE-B2,none}]
                                     [--defaultServerSideEncryptionAlgorithm {AES256}]
                                     [--lifecycleRule LIFECYCLERULES | --lifecycleRules LIFECYCLERULES]
                                     bucketName [{allPublic,allPrivate}]
  /opt/homebrew/bin/b2 upload-file [-h] [--contentType CONTENTTYPE]
                                   [--sha1 SHA1] [--info INFO]
                                   [--custom-upload-timestamp CUSTOM_UPLOAD_TIMESTAMP]
                                   [--cache-control CACHE_CONTROL]
                                   [--content-disposition CONTENT_DISPOSITION]
                                   [--content-encoding CONTENT_ENCODING]
                                   [--content-language CONTENT_LANGUAGE]
                                   [--expires EXPIRES]
                                   [--minPartSize MINPARTSIZE]
                                   [--threads THREADS] [--noProgress]
                                   [--destinationServerSideEncryption {SSE-B2,SSE-C}]
                                   [--destinationServerSideEncryptionAlgorithm {AES256}]
                                   [--legalHold {on,off}]
                                   [--fileRetentionMode {compliance,governance}]
                                   [--retainUntil TIMESTAMP] [--incrementalMode]
                                   bucketName localFilePath b2FileName
  /opt/homebrew/bin/b2 upload-unbound-stream [-h] [--partSize PARTSIZE]
                                             [--unusedBufferTimeoutSeconds UNUSEDBUFFERTIMEOUTSECONDS]
                                             [--contentType CONTENTTYPE]
                                             [--sha1 SHA1] [--info INFO]
                                             [--custom-upload-timestamp CUSTOM_UPLOAD_TIMESTAMP]
                                             [--cache-control CACHE_CONTROL]
                                             [--content-disposition CONTENT_DISPOSITION]
                                             [--content-encoding CONTENT_ENCODING]
                                             [--content-language CONTENT_LANGUAGE]
                                             [--expires EXPIRES]
                                             [--minPartSize MINPARTSIZE]
                                             [--threads THREADS] [--noProgress]
                                             [--destinationServerSideEncryption {SSE-B2,SSE-C}]
                                             [--destinationServerSideEncryptionAlgorithm {AES256}]
                                             [--legalHold {on,off}]
                                             [--fileRetentionMode {compliance,governance}]
                                             [--retainUntil TIMESTAMP]
                                             bucketName localFilePath b2FileName
  /opt/homebrew/bin/b2 update-file-legal-hold [-h] [fileName] fileId {on,off}
  /opt/homebrew/bin/b2 update-file-retention [-h] [--retainUntil TIMESTAMP]
                                             [--bypassGovernance]
                                             [fileName] fileId
                                             {governance,compliance,none}
  /opt/homebrew/bin/b2 replication-setup [-h]
                                         [--destination-profile DESTINATION_PROFILE]
                                         [--name NAME] [--priority PRIORITY]
                                         [--file-name-prefix PREFIX]
                                         [--include-existing-files]
                                         SOURCE_BUCKET_NAME
                                         DESTINATION_BUCKET_NAME
  /opt/homebrew/bin/b2 replication-delete [-h]
                                          SOURCE_BUCKET_NAME
                                          REPLICATION_RULE_NAME
  /opt/homebrew/bin/b2 replication-pause [-h]
                                         SOURCE_BUCKET_NAME
                                         REPLICATION_RULE_NAME
  /opt/homebrew/bin/b2 replication-unpause [-h]
                                           SOURCE_BUCKET_NAME
                                           REPLICATION_RULE_NAME
  /opt/homebrew/bin/b2 replication-status [-h] [--rule REPLICATION_RULE_NAME]
                                          [--destination-profile DESTINATION_PROFILE]
                                          [--dont-scan-destination]
                                          [--output-format {console,json,csv}]
                                          [--noProgress]
                                          [--columns COLUMN ONE,COLUMN TWO]
                                          SOURCE_BUCKET_NAME
  /opt/homebrew/bin/b2 version [-h] [--short]
  /opt/homebrew/bin/b2 license [-h]
  /opt/homebrew/bin/b2 install-autocomplete [-h] [--shell {bash}]
  
  /opt/homebrew/bin/b2: error: the following arguments are required: command
@ppolewicz
Copy link
Collaborator

Hey @nichoth, what did you expect would happen?

@nichoth
Copy link
Author

nichoth commented Jan 1, 2024

From the docs page

Once you have the b2 command-line tool installed, you can type "b2" on the command-line to see all of the options.

@nichoth
Copy link
Author

nichoth commented Jan 1, 2024

The error text at the end of the message is confusing, and the full path vs command was unexpected, eg, /opt/homebrew/bin/b2 vs b2.

@ppolewicz ppolewicz added bug and removed question labels Jan 1, 2024
@mjurbanski-reef
Copy link
Collaborator

Once you have the b2 command-line tool installed, you can type "b2" on the command-line to see all of the options.

Will be adjusted to

Once you have the b2 command-line tool installed, you can type "b2 --help" on the command-line to see all of the options.

the /opt/homebrew/bin/b2 vs b2 will be fixed as well, ideally it should show the basename used to execute the command (this is not always possible/straightforward, for example if someone used python -m b2... (which is not recommended) ).

@mjurbanski-reef
Copy link
Collaborator

the /opt/homebrew/bin/b2 fix have been released in https://github.com/Backblaze/B2_Command_Line_Tool/releases/tag/v3.18.0

@nichoth nichoth closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants