coreutils
coreutils copied to clipboard
nohup interprets subcommand flags as its own flags
If I run, for example, nohup go get -u github.com/kevinburke/rest using the nohup from coreutils, I get this output:
$ ./local/coreutils/bin/nohup go get -u github.com/kevinburke/rest
nohup: error: Unrecognized option: 'u'
nohup 0.0.1
Usage:
nohup COMMAND [ARG]...
nohup OPTION
Run COMMAND ignoring hangup signals.
If standard input is terminal, it'll be replaced with /dev/null.
If standard output is terminal, it'll be appended to nohup.out instead,
or $HOME/nohup.out, if nohup.out open failed.
If standard error is terminal, it'll be redirected to stdout.
Options:
-h, --help Show help and exit
-V, --version Show version and exit
The nohup binary is treating -u as its own command line flag, when it is part of the sub argument.
GNU nohup has no issues running the command above.
OpenBSD nohup does not accept -- before a subcommand, it tries to run a program called --.
GNU nohup accepts -- but also does not try to parse flags in the subcommand as flags in the parent program.
Not sure if this should be a separate issue, but timeout has the same issue.
Fixed since https://github.com/uutils/coreutils/pull/1871 because the trailing_var_arg setting of clap is set (also for timeout).