Coverage for procpath/cli.py: 98%

128 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2026-02-24 19:20 +0000

1import argparse 

2import logging 

3import shutil 

4import sys 

5from datetime import datetime, timezone 

6 

7from . import __version__, cmd, procfile, procret, utility 

8 

9 

10logger = logging.getLogger(__package__) 

11 

12 

13def add_query_parser(parent): 

14 parser = parent.add_parser('query', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

15 Execute given JSONPath and/or SQL query against process tree producing JSON or 

16 separator-delimited values. 

17 ''') 

18 parser.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

19 'query', 

20 nargs='?', 

21 help=''' 

22 JSONPath expression, for example this query returns 

23 PIDs for process subtree including the given root's: 

24 

25 $..children[?(@.stat.pid == 2610)]..pid 

26 ''' 

27 ) 

28 parser.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

29 'sql_query', 

30 nargs='?', 

31 help=''' 

32 SQL query to further filter and/or aggregate collected 

33 process nodes. Note that if JSONPath query is present it must 

34 return full nodes, e.g. $..children[?(@.stat.pid == 2610)]. 

35 For example this query returns total RSS of the processes: 

36 

37 SELECT SUM(stat_rss) / 1024.0 * 4 total FROM record 

38 ''' 

39 ) 

40 

41 arguments = parser.add_argument_group('named arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

42 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

43 '-d', '--delimiter', 

44 help='Join query result using given delimiter', 

45 ) 

46 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

47 '-i', '--indent', 

48 type=int, 

49 help='Format result JSON using given indent number', 

50 ) 

51 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

52 '-e', '--environment', 

53 action='append', 

54 type=lambda s: s.split('=', 1), 

55 help=''' 

56 Commands to evaluate in the shell and template the queries, like VAR=date. 

57 Multiple occurrence is possible. 

58 ''', 

59 ) 

60 

61 add_procfs_group(parser) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

62 

63 parser.set_defaults(output_file=sys.stdout) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

64 

65 

66def add_record_parser(parent): 

67 parser = parent.add_parser('record', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

68 Record the nodes of process tree matching given JSONPath query into a SQLite 

69 database in given intervals. 

70 ''') 

71 parser.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

72 'query', 

73 nargs='?', 

74 help=''' 

75 JSONPath expression, for example this query returns 

76 a node including its subtree for given PID: 

77 

78 $..children[?(@.stat.pid == 2610)] 

79 ''' 

80 ) 

81 

82 arguments = parser.add_argument_group('named arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

83 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

84 '-e', '--environment', 

85 action='append', 

86 type=lambda s: s.split('=', 1), 

87 help=''' 

88 Commands to evaluate in the shell and template the query, like VAR=date. 

89 Multiple occurrence is possible. 

90 ''', 

91 ) 

92 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

93 '-d', '--database-file', 

94 required=True, 

95 help='Path to the recording database file', 

96 ) 

97 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

98 '-p', '--pid-list', 

99 help=''' 

100 Keep only branches with given PIDs in the tree before running query 

101 against it. Comma-separated list. It can include environment 

102 variables. 

103 ''', 

104 ) 

105 

106 loop_control = parser.add_argument_group('loop control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

107 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

108 '-i', '--interval', 

109 type=float, 

110 default='10', 

111 help='Interval in second between each recording, %(default)s by default.', 

112 ) 

113 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

114 '-r', '--recnum', 

115 type=int, 

116 help=''' 

117 Number of recordings to take at --interval seconds apart. 

118 If not specified, recordings will be taken indefinitely. 

119 ''', 

120 ) 

121 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

122 '-v', '--reevalnum', 

123 type=int, 

124 help=''' 

125 Number of recordings after which environment must be re-evaluate. 

126 It's useful when you expect it to change while recordings are 

127 taken. 

128 ''', 

129 ) 

130 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

131 '--stop-without-result', 

132 action='store_true', 

133 help=''' 

134 Prematurely stop recording when target processes can no longer be found, 

135 or otherwise when the query and/or PID filter don't yield a result. 

136 ''', 

137 ) 

138 

139 add_procfs_group(parser) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

140 

141 

142def add_plot_parser(parent): 

143 parser = parent.add_parser('plot', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

144 Plot previously recorded SQLite database using predefined or custom SQL 

145 expression or query. 

146 ''') 

147 

148 file_control = parser.add_argument_group('file control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

149 file_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

150 '-d', '--database-file', 

151 required=True, 

152 help='Path to the database file to read from.', 

153 ) 

154 file_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

155 '-f', '--plot-file', 

156 default='plot.svg', 

157 help='Path to the output SVG file, plot.svg by default.', 

158 ) 

159 

160 query_control = parser.add_argument_group('query control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

161 query_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

162 '-q', '--query-name', 

163 action='append', 

164 dest='query_name_list', 

165 help=f''' 

166 Built-in query name. Available: {", ".join(procret.registry.keys())}. 

167 Without --share-y-axis it can occur once or twice (including other 

168 query-contributing options). In the latter case, the plot has two 

169 Y axes. 

170 ''', 

171 ) 

172 query_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

173 '--custom-query-file', 

174 action='append', 

175 dest='custom_query_file_list', 

176 help=''' 

177 Use custom SQL query in given file. 

178 The result-set must have 3 columns: ts, pid, value. See procpath.procret. 

179 Without --share-y-axis it can occur once or twice (including other 

180 query-contributing options). In the latter case, the plot has two Y axes. 

181 ''', 

182 ) 

183 query_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

184 '--custom-value-expr', 

185 action='append', 

186 dest='custom_value_expr_list', 

187 help=''' 

188 Use custom SELECT expression to plot as the value. 

189 Without --share-y-axis it can occur once or twice (including other 

190 query-contributing options). In the latter case, the plot has two Y axes. 

191 ''', 

192 ) 

193 

194 filter_control = parser.add_argument_group('filter control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

195 filter_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

196 '-a', '--after', 

197 type=lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%S').replace(tzinfo=timezone.utc), 

198 help='Include only points after given UTC date, like 2000-01-01T00:00:00.', 

199 ) 

200 filter_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

201 '-b', '--before', 

202 type=lambda s: datetime.strptime(s, '%Y-%m-%dT%H:%M:%S').replace(tzinfo=timezone.utc), 

203 help='Include only points before given UTC date, like 2000-01-01T00:00:00.', 

204 ) 

205 filter_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

206 '-p', '--pid-list', 

207 type=lambda s: list(map(int, s.split(','))), 

208 help='Include only given PIDs. Comma-separated list.', 

209 ) 

210 

211 plot_control = parser.add_argument_group('plot control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

212 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

213 '-s', '--share-y-axis', 

214 action='store_true', 

215 help='Use the same Y axis for two or more queries.', 

216 ) 

217 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

218 '-l', '--logarithmic', 

219 action='store_true', 

220 help='Plot using logarithmic scale.', 

221 ) 

222 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

223 '--style', 

224 help='Plot using given pygal.style, like LightGreenStyle.', 

225 ) 

226 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

227 '--formatter', 

228 help='Force given pygal.formatter, like integer.', 

229 ) 

230 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

231 '--title', 

232 help='Override plot title.', 

233 ) 

234 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

235 '--no-dots', 

236 action='store_true', 

237 help='Do not add hover dots to the lines.', 

238 ) 

239 plot_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

240 '--relative-time', 

241 action='store_true', 

242 help='Display X axis as time deltas since the first measurement.', 

243 ) 

244 

245 postprocessing_control = parser.add_argument_group('post-processing control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

246 postprocessing_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

247 '-e', '--epsilon', 

248 type=float, 

249 help='Reduce points using Ramer-Douglas-Peucker algorithm and given ε.', 

250 ) 

251 postprocessing_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

252 '-w', '--moving-average-window', 

253 type=int, 

254 help='Smooth the lines using moving average.', 

255 ) 

256 

257 

258def add_watch_parser(parent): 

259 parser = parent.add_parser('watch', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

260 Execute given commands in given intervals. It has similar purpose to 

261 procps watch, but allows JSONPath queries to the process tree to choose 

262 processes of interest. 

263 

264 In each next process' environment exist variables WSP1, WSP2 and so on 

265 containing PIDs of previous shells that run watched processes. 

266 ''') 

267 

268 cmd_control = parser.add_argument_group('command control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

269 cmd_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

270 '-e', '--environment', 

271 action='append', 

272 type=lambda s: s.split('=', 1), 

273 help=''' 

274 Commands to evaluate in the shell, like 

275 C1='docker inspect -f "{{.State.Pid}}" nginx' or D='date +%%s'. 

276 Multiple occurrence is possible. 

277 ''', 

278 ) 

279 cmd_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

280 '-q', '--query', 

281 action='append', 

282 dest='query_list', 

283 type=lambda s: s.split('=', 1), 

284 help=''' 

285 JSONPath expressions that typically evaluate into a list of PIDs. 

286 The environment defined with -e can be used like 

287 L1='$..children[?(@.stat.pid == $C1)]..pid'. 

288 Multiple occurrence is possible. 

289 ''', 

290 ) 

291 cmd_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

292 '-c', '--command', 

293 required=True, 

294 dest='command_list', 

295 action='append', 

296 help=''' 

297 Target command to "watch" in the shell. The environment and query 

298 results can be used like 'smemstat -o smemstat-$D.json -p $L1'. 

299 Query result lists are joined with comma. Multiple occurrence is 

300 possible. 

301 ''', 

302 ) 

303 

304 loop_control = parser.add_argument_group('loop control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

305 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

306 '-i', '--interval', 

307 required=True, 

308 type=float, 

309 help=''' 

310 Interval in second after which to re-evaluate the environment and the 

311 queries, and re-run each command if one has finished. 

312 ''', 

313 ) 

314 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

315 '-r', '--repeat', 

316 type=int, 

317 help='Fixed number of iterations instead of infinite watch.', 

318 ) 

319 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

320 '--no-restart', 

321 action='store_true', 

322 help=''' 

323 Do not restart watched processes when they stop, and stop watching once no 

324 watched process is running. 

325 ''', 

326 ) 

327 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

328 '-s', '--stop-signal', 

329 default='SIGINT', 

330 help='Signal to send to the spawned processes on watch stop. By default: %(default)s.', 

331 ) 

332 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

333 '--kill-after', 

334 type=float, 

335 default='10', 

336 help=''' 

337 Kill all remaining descendant processes after this many seconds after the stop signal 

338 has been sent. By default: %(default)s. 

339 ''', 

340 ) 

341 loop_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

342 '--stream-read-buffer', 

343 type=utility.parse_compact_iec_size, 

344 default='64k', 

345 help=''' 

346 Stream reader buffer size. Lines written by watched processes to standard streams may 

347 not exceed this value. By default: %(default)s. 

348 ''', 

349 ) 

350 

351 add_procfs_group(parser) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

352 

353 

354def add_play_parser(parent): 

355 parser = parent.add_parser('play', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

356 Play one or more sections from given playbook. 

357 ''') 

358 parser.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

359 'target', 

360 nargs='+', 

361 help='''Name or glob-expression of the section from the playbook.''' 

362 ) 

363 

364 arguments = parser.add_argument_group('named arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

365 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

366 '-f', '--playbook-file', 

367 required=True, 

368 help='Path to the playbook to play.', 

369 ) 

370 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

371 '-l', '--list-sections', 

372 action='store_true', 

373 help='List matching sections in the playbook.', 

374 ) 

375 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

376 '-n', '--dry-run', 

377 action='store_true', 

378 help='Collect and print target sections.', 

379 ) 

380 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

381 '-o', '--option', 

382 action='append', 

383 dest='option_override_list', 

384 type=lambda s: s.split('=', 1), 

385 help=''' 

386 A key-value pair to override the option in the playbook, like 

387 database_file=db.sqlite. Multiple occurrence is possible. 

388 ''', 

389 ) 

390 

391 parser.set_defaults(output_file=sys.stdout) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

392 

393 

394def add_explore_parser(parent): 

395 parser = parent.add_parser('explore', formatter_class=HelpFormatter, description=''' (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

396 Serve a Sqliteviz build from a local web-server for exploratory or 

397 ad-hoc visualisation. 

398 

399 On first invocation Sqliteviz is downloaded and saved locally for 

400 later offline use. Procpath exports pre-defined queries into Sqliteviz. 

401 ''') 

402 

403 arguments = parser.add_argument_group('named arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

404 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

405 '--reinstall', 

406 action='store_true', 

407 help='Remove local copy and fetch Sqliteviz build again.', 

408 ) 

409 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

410 '--build-url', 

411 default='https://github.com/lana-k/sqliteviz/releases/latest/download/dist.zip', 

412 help='Sqliteviz build URL. By default: %(default)s.', 

413 ) 

414 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

415 '-b', '--bind', 

416 default='', 

417 metavar='ADDRESS', 

418 help='Specify alternate bind address. By default: all interfaces.', 

419 ) 

420 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

421 '-p', '--port', 

422 default=8000, 

423 type=int, 

424 help='Specify alternate port. By default: %(default)s.', 

425 ) 

426 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

427 '--no-browser', 

428 dest='open_in_browser', 

429 action='store_false', 

430 help='Do not open a browser after startup.', 

431 ) 

432 arguments.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

433 '-d', '--database-file', 

434 help='Database file to pre-load into Sqliteviz.', 

435 ) 

436 

437 

438def add_procfs_group(parser): 

439 procfs_control = parser.add_argument_group('procfs control arguments') (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

440 procfs_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

441 '-f', '--procfile-list', 

442 default='stat, cmdline', 

443 type=lambda s: list(map(str.strip, s.split(','))), 

444 help=f''' 

445 Procfs files to read per PID. Comma-separated list. By default: %(default)s. 

446 Available: {', '.join(procfile.registry.keys())}. 

447 ''', 

448 ) 

449 procfs_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

450 '--procfs', 

451 default='/proc', 

452 type=lambda s: s.rstrip('/'), 

453 help='Procfs mount path. By default: %(default)s.', 

454 ) 

455 procfs_control.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

456 '--procfs-target', 

457 default='process', 

458 type={'process': 'process', 'thread': 'thread'}.__getitem__, 

459 help='Procfs target object. By default: %(default)s. Available: process, thread.', 

460 ) 

461 

462 

463class HelpFormatter(argparse.HelpFormatter): 

464 

465 def __init__(self, prog, indent_increment=2, max_help_position=24, width=None): 

466 if not width: 466 ↛ 469line 466 didn't jump to line 469, because the condition on line 466 was never false(empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

467 width = min(100, shutil.get_terminal_size((80, 20)).columns) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

468 

469 super().__init__(prog, indent_increment, max_help_position, width) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

470 

471 def _format_usage(self, usage, actions, groups, prefix): 

472 banner = ( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

473 r' ___ ___ ___ __ ___ __ _____ _ ''\n' 

474 r' | |_) | |_) / / \ / /` | |_) / /\ | | | |_|''\n' 

475 r' |_| |_| \ \_\_/ \_\_, |_| /_/--\ |_| |_| |''\n\n' 

476 r' a process tree analysis workbench''\n' 

477 ) 

478 result = super()._format_usage(usage, actions, groups, prefix) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

479 if actions: (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

480 result = '{}\n{}'.format(banner, result) 

481 

482 return result (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

483 

484 def _get_default_metavar_for_optional(self, action): 

485 return action.option_strings[-1].strip('-').upper() 

486 

487 

488def build_parser(*, cls=argparse.ArgumentParser): 

489 parser = cls(formatter_class=HelpFormatter) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

490 parser.add_argument('--version', action='version', version=__version__) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

491 parser.add_argument( (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

492 '--logging-level', 

493 help='Logging level. By default: %(default)s.', 

494 default='INFO', 

495 ) 

496 

497 cmd_funcs = [ (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

498 add_query_parser, 

499 add_record_parser, 

500 add_plot_parser, 

501 add_explore_parser, 

502 add_watch_parser, 

503 add_play_parser, 

504 ] 

505 parent = parser.add_subparsers(dest='command', required=True) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

506 for fn in cmd_funcs: (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

507 fn(parent) (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

508 

509 return parser (empty)procpath.test.cmd.TestPlayCommand.test_get_special_argsprocpath.test.cmd.TestPlayCommand.test_play_all_mockedprocpath.test.cmd.TestPlayCommand.test_play_dry_runprocpath.test.cmd.TestPlayCommand.test_play_explicit_extendsprocpath.test.cmd.TestPlayCommand.test_play_missing_argumentsprocpath.test.cmd.TestPlayCommand.test_play_negative_flagprocpath.test.cmd.TestPlayCommand.test_play_plot_flag_args_alignedprocpath.test.cmd.TestPlayCommand.test_play_queryprocpath.test.cmd.TestPlayCommand.test_play_record_plotprocpath.test.cmd.TestPlayCommand.test_play_section_inheritanceprocpath.test.cmd.TestPlayCommand.test_play_unrecognised_argumentsprocpath.test.cmd.TestPlayCommand.test_play_watchprocpath.test.cmd.TestPlayCommand.test_play_watch_overrideprocpath.test.unit.TestCli.test_build_parser_exploreprocpath.test.unit.TestCli.test_build_parser_playprocpath.test.unit.TestCli.test_build_parser_plotprocpath.test.unit.TestCli.test_build_parser_queryprocpath.test.unit.TestCli.test_build_parser_recordprocpath.test.unit.TestCli.test_build_parser_watch

510 

511 

512def is_not_jsonpyth_debug_noise(record: logging.LogRecord) -> bool: 

513 is_jsonpyth_debug_noise = ( 

514 record.module == 'jsonpyth' 

515 and record.levelno == logging.DEBUG 

516 and record.name == 'root' 

517 ) 

518 return not is_jsonpyth_debug_noise 

519 

520 

521def main(): 

522 logging.basicConfig( 

523 level=logging.INFO, 

524 format='%(asctime)s %(levelname)-7s %(name)s %(message)s', 

525 datefmt='%Y-%m-%d %H:%M:%S', 

526 ) 

527 logging.getLogger().addFilter(is_not_jsonpyth_debug_noise) 

528 

529 kwargs = vars(build_parser().parse_args()) 

530 logging.root.setLevel(kwargs.pop('logging_level')) 

531 try: 

532 cmd.get_command(kwargs.pop('command'))(**kwargs) 

533 except KeyboardInterrupt: 533 ↛ 534line 533 didn't jump to line 534, because the exception caught by line 533 didn't happen

534 pass 

535 except cmd.CommandError as ex: 

536 logger.error(ex) 

537 sys.exit(1)