]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/systemctl/systemctl.c
systemctl: be nice to users and give hint how to specify "-.mount"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Dec 2018 14:04:14 +0000 (15:04 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Dec 2018 01:49:03 +0000 (02:49 +0100)
commit2e7e19cafc01fcfa113be3b63d5f8b374e02a4a4
tree71c035b78fc4febd7a63da83be32469e4d19fc29
parent0f495e01232aba5e057256cd0b4be810057e9b09
systemctl: be nice to users and give hint how to specify "-.mount"

https://bugzilla.redhat.com/show_bug.cgi?id=1656639
Using "--" is a trick that is hard to discover. Let's give users a hint:

$ build/systemctl status -.service
  build/systemctl: invalid option -- '.'
  Hint: to specify units starting with a dash, use "--":
        build/systemctl [OPTIONS...] {COMMAND} -- -.service ...

I use program_invocation_name because that's what getopt seems to use.
"::" is used in the option string so that getopt doesn't complain about
a missing argument in case somebody passes "-." as the argument. After all
"." is not a real option.
src/systemctl/systemctl.c