MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / do_page_wrap

Method do_page_wrap

examples/paged_output.py:26–34  ·  view source on GitHub ↗

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])

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

page_fileMethod · 0.95
perrorMethod · 0.80

Tested by

no test coverage detected