Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joanne Hugé
re6stnet
Commits
d6ab9f80
Commit
d6ab9f80
authored
Sep 08, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow use of short option in option file
parent
752cfeea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
re6st/utils.py
re6st/utils.py
+8
-5
No files found.
re6st/utils.py
View file @
d6ab9f80
import
argparse
,
errno
,
logging
,
os
,
signal
,
struct
,
socket
,
textwrap
,
time
import
argparse
,
errno
,
logging
,
os
,
shlex
import
signal
,
struct
,
socket
,
textwrap
,
time
from
OpenSSL
import
crypto
from
OpenSSL
import
crypto
logging_levels
=
logging
.
WARNING
,
logging
.
INFO
,
logging
.
DEBUG
,
5
logging_levels
=
logging
.
WARNING
,
logging
.
INFO
,
logging
.
DEBUG
,
5
...
@@ -77,13 +78,15 @@ class ArgParser(argparse.ArgumentParser):
...
@@ -77,13 +78,15 @@ class ArgParser(argparse.ArgumentParser):
" Serial number defines the prefix of the network."
" Serial number defines the prefix of the network."
def
convert_arg_line_to_args
(
self
,
arg_line
):
def
convert_arg_line_to_args
(
self
,
arg_line
):
arg_line
=
arg_line
.
split
(
'#'
)[
0
].
rstrip
()
arg_line
=
arg_line
.
split
(
'#'
,
1
)[
0
].
rstrip
()
if
arg_line
:
if
arg_line
:
if
arg_line
.
startswith
(
'@'
):
if
arg_line
.
startswith
(
'@'
):
yield
arg_line
yield
arg_line
return
return
for
arg
in
(
'--'
+
arg_line
.
lstrip
(
'--'
)).
split
():
arg_line
=
shlex
.
split
(
arg_line
)
if
arg
.
strip
():
arg
=
'--'
+
arg_line
.
pop
(
0
)
yield
arg
[
arg
not
in
self
.
_option_string_actions
:]
for
arg
in
arg_line
:
yield
arg
yield
arg
def
__init__
(
self
,
**
kw
):
def
__init__
(
self
,
**
kw
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment