manly icon indicating copy to clipboard operation
manly copied to clipboard

Allow subcommands for some commands

Open m42e opened this issue 5 years ago • 6 comments

Support subcommands for e.g. git like git status which have their own man pages.

m42e avatar Oct 04 '18 12:10 m42e

So far, I have invoked commands with hyphens (manly git-branch ...) to use manly for subcommands. I am considering if this is better.

This is a high quality patch and I appreciate your interest in improving the project. Do you think there are other solutions than maintaining a list of commands that have sub commands?

carlbordum avatar Oct 04 '18 17:10 carlbordum

I already thought about it, but I haven’t had a idea that was simple but works well.

  • There is no common syntax in makefiles for this case
  • A config file would not be a good option imho
  • A try error would be possible but increase runtime (may be the best option)

What do you think?

m42e avatar Oct 04 '18 18:10 m42e

I mean we could try concatenating the words starting without hyphens first and then go for the regular manpage if that fails. This feels a little bit icky to me (but please object, if you think otherwise!), so I'm inclined to go with your original proposal or print a warning to stderr when the user types a command with multiple words in row without hyphens.

carlbordum avatar Oct 04 '18 18:10 carlbordum

What do you think about Häsin ganz environment variable and set it to the values I entered as default?

m42e avatar Oct 06 '18 16:10 m42e

I'm sorry, but I dont understand your comment :D

carlbordum avatar Oct 08 '18 15:10 carlbordum

Sorry that was my fault, or the iOS autocorrection feature

What do you think of defining the commands that use subcommands as an environment variable. The default could still be the ones I added, but it is up to the user to redefine or extend the list.

m42e avatar Oct 08 '18 15:10 m42e