Colourise and automatically page help output
Using the autopage library we can automatically send the help output to a pager (less, by default), git-style. The pager is configured to not reset the terminal on exit, avoiding the problem when piping to less manually that the help text you want to refer to disappears off the screen when you go to use it. The pager is only invoked when the output is to the terminal. Since we invoke the pager, we can ensure that it is correctly set up to interpret ANSI escape codes, so it is safe to use colour to make the output easier to read. The autopage library provides light styling of the default argparse help output, and some additional colour highlighting is added here for the command list (which is generated by cliff, not using argparse's formatting code). Change-Id: If9e1aa5166da32c58cc0fa617f4f81eaa9b2c470 Depends-On: https://review.opendev.org/c/openstack/requirements/+/799343
Loading
Please register or sign in to comment