-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcompletion.sh
executable file
·105 lines (96 loc) · 3.03 KB
/
completion.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# Bash Completion Script for ransomcmd.py
# ----------------------------------------
# This script provides command-line tab completion for the ransomcmd.py tool.
# It includes subcommands and options based on the functionality provided by the tool.
# To use this script, save it to your home directory and source it from your .bashrc file.
#
# Instructions:
# 1. Install bash_completion
# sudo apt-get install bash-completion
# 2. Add `source ransomcmd_completion.sh` to your ~/.bashrc file.
# 3. Reload your bash configuration using `source ~/.bashrc`.
# 4. Navigate to the directory containing ransomcmd.py and test the completion by typing:
# `./ransomcmd.py [Tab]`
#
# ----------------------------------------
_ransomcmd_completions()
{
local cur prev subcommands opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# Define the subcommands based on the list provided
subcommands="scrape parse generate screenshot status search rss infostealer tools add append"
# Global options
global_opts="--help --version"
# Complete subcommands when typing the main command
if [[ ${COMP_CWORD} == 1 ]]; then
COMPREPLY=( $(compgen -W "${subcommands} ${global_opts}" -- ${cur}) )
return 0
fi
# Customize completion based on the subcommand
case "${prev}" in
scrape)
opts="--group"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
parse)
opts="--group"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
generate)
opts=""
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
screenshot)
opts="--group --url"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
status)
opts=""
COMPREPLY=()
return 0
;;
search)
opts="--victim"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
rss)
opts=""
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
infostealer)
opts="--domain"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
tools)
opts="duplicate order blur"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
blur)
opts="--file"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
add)
opts="--name --location"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
append)
opts="--name --location"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
;;
esac
}
complete -F _ransomcmd_completions ./ransomcmd.py