Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ipaaca
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Social Cognitive Systems
ipaaca
Commits
76e7dd04
Commit
76e7dd04
authored
9 years ago
by
Hendrik Buschmeier
Browse files
Options
Downloads
Patches
Plain Diff
ipaaca-iu-sniffer: Now defaults to colored output; -c as short form of --categories.
parent
62b2a69f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ipaacatools/scripts/ipaaca-iu-sniffer
+15
-15
15 additions, 15 deletions
ipaacatools/scripts/ipaaca-iu-sniffer
with
15 additions
and
15 deletions
ipaacatools/scripts/ipaaca-iu-sniffer
+
15
−
15
View file @
76e7dd04
...
...
@@ -56,7 +56,7 @@ def event_type_color(typ):
return
colors
.
get
(
typ
,
'
1
'
)
def
highlight_if_color
(
s
,
c
=
'
1
'
):
return
s
if
not
arguments
.
color
else
'
[
'
+
c
+
'
m
'
+
s
+
'
[m
'
return
s
if
arguments
.
color
else
'
[
'
+
c
+
'
m
'
+
s
+
'
[m
'
def
pretty_printed_dict
(
d
):
s
=
'
{
\n
'
...
...
@@ -99,16 +99,6 @@ def my_update_handler(iu, event_type, local):
parser
=
ipaaca
.
IpaacaArgumentParser
(
description
=
'
Ipaaca IU Sniffer -- Selectively listen to IPAACA traffic
'
)
parser
.
add_argument
(
'
-r
'
,
'
--regex
'
,
action
=
'
store_true
'
,
dest
=
'
regex
'
,
help
=
'
match categories by regular expressions
'
)
parser
.
add_argument
(
'
-c
'
,
'
--color
'
,
action
=
'
store_true
'
,
dest
=
'
color
'
,
help
=
'
colorize output
'
)
parser
.
add_argument
(
'
--channels
'
,
dest
=
'
channels
'
,
...
...
@@ -117,12 +107,22 @@ parser.add_argument(
nargs
=
'
+
'
,
help
=
"
set the channels to listen on (otherwise
'
default
'
)
"
)
parser
.
add_argument
(
'
--categories
'
,
'
-c
'
,
'
--categories
'
,
default
=
[
''
],
dest
=
'
categories
'
,
metavar
=
'
CATEGORY
'
,
nargs
=
'
+
'
,
help
=
'
set categories (or regex patterns) to be matched
'
)
parser
.
add_argument
(
'
-r
'
,
'
--regex
'
,
action
=
'
store_true
'
,
dest
=
'
regex
'
,
help
=
'
match categories by regular expressions
'
)
parser
.
add_argument
(
'
--no-color
'
,
action
=
'
store_true
'
,
dest
=
'
color
'
,
help
=
'
do not colorize output
'
)
parser
.
add_argument
(
'
--size-limit
'
,
default
=
2048
,
...
...
@@ -146,7 +146,7 @@ if __name__ == '__main__':
channellist
=
'
s
'
if
len
(
arguments
.
channels
)
>
1
else
'
'
channellist
+=
'
,
'
.
join
(
arguments
.
channels
)
print
(
'
Listening on channel
'
+
channellist
+
'
for IU events of
'
,
end
=
''
)
if
arguments
.
categories
==
[
''
]:
print
(
'
any category ...
'
)
...
...
@@ -162,9 +162,9 @@ if __name__ == '__main__':
time
.
sleep
(
1
)
except
KeyboardInterrupt
:
pass
if
platform
.
system
()
==
'
Windows
'
:
os
.
_exit
(
0
)
else
:
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment