You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.org
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -304,7 +304,7 @@ In the same way the data fields will be cut off and a message displayed for the
304
304
+--------------+
305
305
#+end_src
306
306
307
-
Usually the chunk size is calculated from the config file, but it can be set manually with the argument ~-b / --chunksize~. (In bytes) In the case that the sum of the length of the fields in config is bigger than the size from the argument, the message "values size is bigger than what is left of that data chunk" will be displayed for the fields that have no data. If the chunk size from the argument is bigger, the remaining bytes from that chunk will not be evaluated.
307
+
Usually the chunk size is calculated from the config file, but it can be set manually with the argument ~--chunksize~. (In bytes) In the case that the sum of the length of the fields in config is bigger than the size from the argument, the message "values size is bigger than what is left of that data chunk" will be displayed for the fields that have no data. If the chunk size from the argument is bigger, the remaining bytes from that chunk will not be evaluated.
308
308
309
309
* Record to ~--outfile~
310
310
Please note that writing to a file is different that piping stdout of mview into a file like this:
Copy file name to clipboardExpand all lines: src/args.rs
+27-17Lines changed: 27 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,7 @@ impl Args {
35
35
Arg::with_name("outfile")
36
36
.short('w')
37
37
.long("outfile")
38
+
.visible_short_alias('o')
38
39
.takes_value(true)
39
40
.help("Write output to a file instead of stdout"),
40
41
)
@@ -53,24 +54,28 @@ impl Args {
53
54
.help("Read from a PCAP formatted file or data stream"),
54
55
)
55
56
.arg(
56
-
Arg::with_name("chunksize")
57
-
.short('b')
57
+
Arg::with_name("chunksize (bytes)")
58
+
.short('s')
58
59
.long("chunksize")
59
60
.takes_value(true)
60
61
.value_parser(clap::value_parser!(usize))
61
-
.help("flush stdout and restart matching after n bytes"),
62
+
.help("Restart matching after n bytes")
63
+
.long_help("Restart matching after n bytes. If this argument is not given the size of a chunk is determined from the config.
64
+
If chunksize is longer than a message, the chunk is filled with message data from the start until mview runs out of message data. Fields of the chunk that are left will not get a value.
65
+
If chunksize is shorter than a message, the whole chunk will be filled with the message data, mview will print out that chunk and then start filling the next chunk with the remaining data from the message.
66
+
For a graphical explaination of how mview handles message and chunk lengths see Readme.
67
+
"),
62
68
)
63
69
.arg(
64
70
Arg::with_name("offset (bytes)")
65
-
.short('o')
66
71
.long("offset")
72
+
.visible_alias("byteoffset")
67
73
.takes_value(true)
68
74
.value_parser(clap::value_parser!(usize))
69
75
.help("offset in bytes at the start of a chunk before parsing starts"),
70
76
)
71
77
.arg(
72
78
Arg::with_name("offset (bits)")
73
-
.short('s')
74
79
.long("bitoffset")
75
80
.takes_value(true)
76
81
.value_parser(clap::value_parser!(usize))
@@ -80,6 +85,7 @@ impl Args {
80
85
Arg::with_name("rawhex")
81
86
.short('r')
82
87
.long("rawhex")
88
+
.visible_alias("raw")
83
89
.takes_value(false)
84
90
.help("Print raw hexdump of the chunk at top of output"),
85
91
)
@@ -96,7 +102,7 @@ impl Args {
96
102
.help("Print raw ascii of the chunk at top of output"),
97
103
)
98
104
.arg(
99
-
Arg::with_name("pause")
105
+
Arg::with_name("pause (ms)")
100
106
.long("pause")
101
107
.short('p')
102
108
.takes_value(true)
@@ -105,7 +111,8 @@ impl Args {
105
111
)
106
112
.arg(
107
113
Arg::with_name("little endian")
108
-
.long("le")
114
+
.long("little-endian")
115
+
.visible_aliases(&["le","littleendian"])
109
116
.takes_value(false)
110
117
.help("Interpret integers as little endian (default is big endian)."),
111
118
)
@@ -117,12 +124,11 @@ impl Args {
117
124
.help("Display timestamp of each chunk."),
118
125
)
119
126
.arg(
120
-
Arg::with_name("read head")
121
-
.short('h')
127
+
Arg::with_name("head (bytes)")
122
128
.long("head")
123
129
.takes_value(true)
124
130
.value_parser(clap::value_parser!(usize))
125
-
.help("Read only the first x bytes where is the number given and then exit."),
131
+
.help("Read only the first x bytes where x is the number given, print that as a message and then exit."),
126
132
)
127
133
.arg(
128
134
Arg::with_name("print statistics")
@@ -140,7 +146,9 @@ impl Args {
140
146
Arg::with_name("no cursor jumping")
141
147
.long("--nojump")
142
148
.takes_value(false)
143
-
.help("Print to stdout like printing to a file with option --outfile"),
149
+
.help("Print to stdout like printing to a file with option --outfile")
150
+
.long_help("Print to stdout like printing to a file with option --outfile. Do not jump back the amount of lines printed before printing the next chunk when printing to stdout."),
151
+
)
144
152
.arg(
145
153
Arg::with_name("clear")
146
154
.long("--clear")
@@ -152,36 +160,38 @@ impl Args {
152
160
Arg::with_name("filter newlines")
153
161
.long("--filter-newlines")
154
162
.takes_value(false)
155
-
.help("Filter newline characters from string fields"),
163
+
.help("Filter newline characters from string fields")
164
+
.long_help("Filter newline characters from string fields. Normally mview tries to not alter the data of a message and prints it 'as is'.
165
+
However, this can result it a mess when strings in the message contain control characters like \\n. To avoid making a mess this argument lets mview filter the strings from newline characters"),
156
166
)
157
167
.get_matches();
158
168
let infile = matches.value_of("infile").unwrap_or_default().to_string();
159
169
let outfile = matches.value_of("outfile").unwrap_or_default().to_string();
160
170
let config = matches.value_of("config").unwrap_or_default().to_string();
161
171
let pcap = matches.is_present("pcap");
162
172
let chunksize = matches
163
-
.try_get_one::<usize>("chunksize")
173
+
.try_get_one::<usize>("chunksize (bytes)")
164
174
.unwrap_or_default()
165
175
.unwrap_or(&0);
166
176
let offset = matches
167
-
.try_get_one::<usize>("offset")
177
+
.try_get_one::<usize>("offset (bytes)")
168
178
.unwrap_or_default()
169
179
.unwrap_or(&0);
170
180
let bitoffset = matches
171
-
.try_get_one::<usize>("bitoffset")
181
+
.try_get_one::<usize>("offset (bits)")
172
182
.unwrap_or_default()
173
183
.unwrap_or(&0);
174
184
let rawhex = matches.is_present("rawhex");
175
185
let rawbin = matches.is_present("rawbin");
176
186
let rawascii = matches.is_present("rawascii");
177
187
let pause = matches
178
-
.try_get_one::<u64>("pause")
188
+
.try_get_one::<u64>("pause (ms)")
179
189
.unwrap_or_default()
180
190
.unwrap_or(&0);
181
191
let little_endian = matches.is_present("little endian");
182
192
let timestamp = matches.is_present("timestamp");
183
193
let read_head = matches
184
-
.try_get_one::<usize>("read head")
194
+
.try_get_one::<usize>("head (bytes)")
185
195
.unwrap_or_default()
186
196
.unwrap_or(&0);
187
197
let print_statistics = matches.is_present("print statistics");
0 commit comments