Skip to content

サブコマンドで指定を間違えてもリターンコードが0になっている #27

@cohama

Description

@cohama
$ nextcloud-cli download
NAME:
   nextcloud-cli download - Download remote files or directories

USAGE:
   nextcloud-cli download [command options] FILE [FILE...]

OPTIONS:
   --out value, -o value  set output directory (default: ".")
   --retry value          set max retry count (default: 5)
   --deconflict value     set deconflict strategy (skip/overwrite/newest/error) (default: "error")
   --procs value          set maximum number of processes (default: 10)
   --help, -h             show help (default: false)

$ echo $?
0

大抵のコマンドは引数が足りなかったりした場合は Usage 出すとともに0以外を返す気がします。

$ aws s3 cp
Note: AWS CLI version 2, the latest major version of the AWS CLI, is now stable and recommended for general use. For more information, see the AWS CLI version 2 installation instructions at: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: the following arguments are required: paths

$ echo $?
2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions