Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
routersploit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
czos-dpend
routersploit
Commits
0ad33dc2
Commit
0ad33dc2
authored
Jun 25, 2016
by
fwkz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introducing unsetg command
parent
4ef9e2f5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
interpreter.py
routersploit/interpreter.py
+22
-0
No files found.
routersploit/interpreter.py
View file @
0ad33dc2
from
__future__
import
print_function
import
os
import
sys
import
itertools
import
traceback
import
atexit
...
...
@@ -316,6 +317,27 @@ class RoutersploitInterpreter(BaseInterpreter):
return
self
.
complete_set
(
text
,
*
args
,
**
kwargs
)
@utils.module_required
def
command_unsetg
(
self
,
*
args
,
**
kwargs
):
key
,
_
,
value
=
args
[
0
]
.
partition
(
' '
)
if
key
in
self
.
current_module
.
options
:
try
:
del
GLOBAL_OPTS
[
key
]
except
KeyError
:
utils
.
print_error
(
"There is no such option set!"
)
else
:
utils
.
print_success
({
key
:
value
})
else
:
utils
.
print_error
(
"You can't unset global option '{}'.
\n
"
"Available global options: {}"
.
format
(
key
,
GLOBAL_OPTS
.
keys
()))
@utils.stop_after
(
2
)
def
complete_unsetg
(
self
,
text
,
*
args
,
**
kwargs
):
if
text
:
return
[
' '
.
join
((
attr
,
""
))
for
attr
in
GLOBAL_OPTS
.
keys
()
if
attr
.
startswith
(
text
)]
else
:
return
GLOBAL_OPTS
.
keys
()
@utils.module_required
def
get_opts
(
self
,
*
args
):
""" Generator returning module's Option attributes (option_name, option_value, option_description)
...
...
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