Help command auto piped to less

0 views
Skip to first unread message

Alexandru Bolboaca

unread,
Jun 12, 2013, 10:48:28 AM6/12/13
to sta...@clarkparsia.com

When I run the help command, sometimes I need to scroll in the terminal. To avoid this, I pipe to less all the time.

It would be nice if the help command would pipe to less automatically.

Mike Grove

unread,
Jun 12, 2013, 10:52:12 AM6/12/13
to stardog
You can pretty easily modify the bash scripts to do this, for example the last line in the stardog script is:

exec ${java} ${STARDOG_JAVA_ARGS} -server -jar ${DIRNAME}/lib/stardog-cli.jar "$@"

if you modify that to 

if [ $1 = 'help' ]
  exec ${java} ${STARDOG_JAVA_ARGS} -server -jar ${DIRNAME}/lib/stardog-cli.jar "$@" | less
else
  exec ${java} ${STARDOG_JAVA_ARGS} -server -jar ${DIRNAME}/lib/stardog-cli.jar "$@"
fi

it should do precisely what you want.

Cheers,

Mike



On Wed, Jun 12, 2013 at 10:48 AM, Alexandru Bolboaca <alex...@gmail.com> wrote:

When I run the help command, sometimes I need to scroll in the terminal. To avoid this, I pipe to less all the time.

It would be nice if the help command would pipe to less automatically.

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
 
 

Alexandru Bolboaca

unread,
Jun 13, 2013, 5:06:10 AM6/13/13
to sta...@clarkparsia.com
Thank you for the suggestion. It's helpful.

I won't hide that I would've preferred having it integrated in the release. Git does this automatically.

Alex

Kendall Clark

unread,
Jun 13, 2013, 8:48:14 AM6/13/13
to stardog
Git and an RDF database are very different kinds of animal.

We talked about this a bit more and I can see calling the user's PAGER variable at the end of each CLI invocation.

I use most; some people use less. For users who care a lot about this, they could set PAGER to whatever pager with args make the most sense in their environment.

Cheers,
Kendall


--

Alexandru Bolboaca

unread,
Jun 13, 2013, 9:04:25 AM6/13/13
to sta...@clarkparsia.com
Thanks for considering it.

Your solution makes a lot of sense. Pagers are a matter of preference and choosing one over another is better left at the user's choice.

As for the differences between git and stardog, while they are very different indeed, the differences become less important when asking for help from command line. The only thing that matters in this context is the type of user and the usability. I would argue that the command line for stardog is used by programmers and administrators, probably much like git. I might be wrong though; you know your audience better. As for the usability, not having to scroll up to read the beginning of the help and being able to search inside the help is definitely better than the alternative. I know I use this a lot.

An alternate way, that git uses on windows, is to display the local help in a browser window using html. I don't like that as much, but it has the additional benefit of cross-linking the help articles and navigating through documentation easier.

Anyway, thanks for your help and for considering these ideas.

Kendall Clark

unread,
Jun 13, 2013, 9:20:12 AM6/13/13
to stardog
On Thu, Jun 13, 2013 at 9:04 AM, Alexandru Bolboaca <alex...@gmail.com> wrote:
Thanks for considering it.

Your solution makes a lot of sense. Pagers are a matter of preference and choosing one over another is better left at the user's choice.

Right. Until then, it's not like paging to a pager explicitly or just tweaking the shell scripts we ship is *hard*. :>

Cheers,
Kendall 
Reply all
Reply to author
Forward
0 new messages