- 29 Sep, 2021 1 commit
-
-
Thomas Goirand authored
-
- 25 Aug, 2021 1 commit
-
-
Thomas Goirand authored
-
- 13 Jul, 2021 5 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
-
Zane Bitter authored
Include "autopage" in the name so that there's no possibility of future colisions with argparse.
-
Zane Bitter authored
Clients that implement their own Actions need an API to allow them to set the ColorHelpFormatter into color mode.
-
Zane Bitter authored
-
- 01 Jul, 2021 1 commit
-
-
Zane Bitter authored
-
- 25 Jun, 2021 3 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
These are not helpful for distro packaging.
-
Zane Bitter authored
-
- 19 Jun, 2021 3 commits
-
-
Zane Bitter authored
This is useful for tests in distro packaging. Also ensure that we use setuptools>=43 so that pyproject.toml will always be included as well.
-
Zane Bitter authored
-
Zane Bitter authored
The --exclude CLI option does not exist in the 0.7xx versions.
-
- 06 Jun, 2021 2 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
It is not enough to catch and handle KeyboardInterrupt while waiting for the user to exit the pager. A KeyboardInterrupt can occur between any two Python opcodes. Furthermore, it may (indeed, in some cases it appears quite likely to) occur while flushing the write buffer and closing the output stream. The only way to fully protect against this is to ignore the signal altogether for the duration of the cleanup.
-
- 05 Jun, 2021 5 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
If the output consumer closes before we are able to write all output to it, then it is irrelevant whether the code inside the context manager encountered a BrokenPipeError or if it only occurs when trying to flush the buffer filled by that code. Therefore, set the SIGPIPE return code if flushing the buffer fails.
-
Zane Bitter authored
Constants are available in the signal module, and may theoretically be different on different platforms.
-
Zane Bitter authored
If the stream is closed, don't fail until we try to actually use it.
-
Zane Bitter authored
Add a function to create an AutoPager with the recommended settings for help output, for use by programs that don't use the default argparse help action.
-
- 04 Jun, 2021 1 commit
-
-
Zane Bitter authored
By default, Python enables line buffering on stdout whenever stdout is connected to a console - which is exactly when we will start a pager. As a consequence, the --quit-if-one-screen option was never enabled unless the AutoPager was explicitly created with line_buffering=False. This isn't a great default, given that the programmer knows that the output will be going to a pager, so only disable --quit-if-one-screen if line buffering is explicitly turned on.
-
- 27 May, 2021 1 commit
-
-
Zane Bitter authored
Split parts that would be common to both regular and asynchronous context managers into separate methods.
-
- 15 May, 2021 3 commits
-
-
Zane Bitter authored
Explicitly set line buffering to False when printing the help, to ensure that we always quit the pager if there is less than one screen's worth of data. Also explicitly set allow_color to True, since we're now relying on this.
-
Zane Bitter authored
Start introducing styling in the help output from argparse. For now this is just underlining section titles and putting metavars in italics.
-
Zane Bitter authored
-
- 14 May, 2021 3 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
Set the correct environment for when lv is specified as the pager.
-
Zane Bitter authored
If we can't start the pager (e.g. because less or the pager specified as $PAGER doesn't exist on the system), catch the exception and fall back to outputting directly to the terminal without paging.
-
- 24 Apr, 2021 4 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
Previously, we always allowed less to reset the terminal when exiting (as it does by default when being run manually), so that the output of the program did not remain on screen. This is desirable in some applications, but less so in others. Git does not clear the screen and instead leaves the last shown output displayed. Change the default to do the same here. Since clearing the screen is sometimes desirable, add a configuration option to allow the developer to choose this. If we quit the pager immediately due to having less than one screen's worth of data to display, then the output will obviously always be left on the screen. This is inconsistent with a request to reset the terminal on completion, so do not pass this option when the terminal is to be reset.
-
Zane Bitter authored
If the user wishes to override the settings configured in the environment, they need to be able to specify a custom PAGER environment variable containing arguments as well as the name of the pager. Popen does not support this being passed as a string unless shell=True, but we generally don't want to be enabling shell interpretation. Therefore split the arguments using the shlex module.
-
Zane Bitter authored
-
- 23 Apr, 2021 7 commits
-
-
Zane Bitter authored
-
Zane Bitter authored
-
Zane Bitter authored
Convert the 'errors' argument to an ErrorStrategy, so that if a valid strategy is passed as a string it will still work when we get self._set_errors.value, and if an invalid strategy is passed we'll get an exception raised immediately.
-
Zane Bitter authored
The string value of an Enum member is a representation of the name, not the actual value.
-
Zane Bitter authored
-
Zane Bitter authored
-
Zane Bitter authored
-