Read in a text file and display its output in a pager, wrapping long lines if they don't fit. Usage: page_wrap
(self, args: list[str])
| 24 | |
| 25 | @cmd2.with_argument_list |
| 26 | def do_page_wrap(self, args: list[str]) -> None: |
| 27 | """Read in a text file and display its output in a pager, wrapping long lines if they don't fit. |
| 28 | |
| 29 | Usage: page_wrap <file_path> |
| 30 | """ |
| 31 | if not args: |
| 32 | self.perror("page_wrap requires a path to a file as an argument") |
| 33 | return |
| 34 | self.page_file(args[0], chop=False) |
| 35 | |
| 36 | complete_page_wrap = cmd2.Cmd.path_complete |
| 37 |