Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Smash_pass
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
Smashpass
Smash_pass
Commits
792c364a
Commit
792c364a
authored
Dec 09, 2024
by
Benjamin REED
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added rename command
parent
245788f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
main.py
main.py
+12
-0
No files found.
main.py
View file @
792c364a
...
...
@@ -20,6 +20,7 @@ USAGES = {
"undo"
:
"undo - undoes the latest deletion/modification"
,
"history"
:
"history - prints all the deleted passwords"
,
"cfg"
:
"config [ <param=newparam> ] - configures the current program state or lists it when run without arguments. Example: 'config hints=False'"
,
"rename"
:
"rename <label> <newlabel> - renames a password"
,
}
DEFAULT_KEYGEN_ITERATIONS
=
100_000
LOWERCASE_ALPHABET
=
set
([
chr
(
e
)
for
e
in
range
(
ord
(
'a'
),
ord
(
'a'
)
+
25
)])
...
...
@@ -323,6 +324,17 @@ def main():
print
(
f
"Restored {og_label}"
)
else
:
print
(
f
"Label '{og_label}' could not be found in deleted or overwritten passwords"
)
elif
command
==
"rename"
or
command
==
"rn"
:
if
len
(
args
)
<
3
:
print
(
f
"Too few args for {command}. Usage: {USAGES['rename']}."
)
continue
if
args
[
1
]
in
state
.
passwords
:
state
.
passwords
[
args
[
2
]]
=
state
.
passwords
[
args
[
1
]]
del
state
.
passwords
[
args
[
1
]]
print
(
f
"{args[1]} -> {args[2]}"
)
else
:
print
(
f
"{args[1]} is not a known password label"
)
elif
command
==
"history"
or
command
==
"his"
or
command
==
"undolist"
:
print
(
"Deleted:"
)
for
remd
in
state
.
to_remove
:
...
...
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