20
20
type = click .Path (file_okay = False , writable = True , path_type = Path ),
21
21
envvar = "QBPM_PROFILE_DIR" ,
22
22
default = default_profile_dir ,
23
+ help = "directory in which profiles are stored" ,
23
24
)
24
25
@click .pass_context
25
26
def main (ctx , profile_dir : Path ) -> None :
26
- # TODO version, documentation
27
- # TODO -h as --help
27
+ # TODO version
28
28
ctx .ensure_object (dict )
29
29
ctx .obj ["PROFILE_DIR" ] = profile_dir
30
30
@@ -37,7 +37,8 @@ def main(ctx, profile_dir: Path) -> None:
37
37
@click .option ("-l" , "--launch" , is_flag = True )
38
38
@click .option ("-f" , "--foreground" , is_flag = True )
39
39
@click .pass_context
40
- def new (ctx , profile_name : str , launch : bool , foreground : bool , ** kwargs ):
40
+ def new (ctx , profile_name : str , ** kwargs ):
41
+ """Create a new profile."""
41
42
profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
42
43
then_launch (profiles .new_profile , profile , ** kwargs )
43
44
@@ -56,6 +57,10 @@ def from_session(
56
57
profile_name : Optional [str ],
57
58
** kwargs ,
58
59
):
60
+ """Create a new profile from a saved qutebrowser session.
61
+ SESSION may be the name of a session in the global qutebrowser profile
62
+ or a path to a session yaml file.
63
+ """
59
64
profile , session_path = session_info (session , profile_name , ctx .obj ["PROFILE_DIR" ])
60
65
then_launch (operations .from_session , profile , session_path = session_path , ** kwargs )
61
66
@@ -67,6 +72,7 @@ def desktop(
67
72
ctx ,
68
73
profile_name : str ,
69
74
):
75
+ """Create a desktop file for an existing profile."""
70
76
profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
71
77
exit_with (operations .desktop (profile ))
72
78
@@ -77,16 +83,25 @@ def desktop(
77
83
@click .option ("-f" , "--foreground" , is_flag = True )
78
84
@click .pass_context
79
85
def launch (ctx , profile_name : str , ** kwargs ):
86
+ """Launch qutebrowser with a specific profile."""
80
87
profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
81
88
# TODO qb args
82
89
exit_with (operations .launch (profile , qb_args = [], ** kwargs ))
83
90
84
91
85
92
@main .command ()
86
- @click .option ("-m" , "--menu" )
93
+ @click .option (
94
+ "-m" ,
95
+ "--menu" ,
96
+ metavar = "COMMAND" ,
97
+ help = f"A dmenu-compatible command or one of the following supported menus: { ', ' .join (sorted (SUPPORTED_MENUS ))} " ,
98
+ )
87
99
@click .option ("-f" , "--foreground" , is_flag = True )
88
100
@click .pass_context
89
101
def choose (ctx , ** kwargs ):
102
+ """Choose a profile to launch.
103
+ Support is built in for many X and Wayland launchers, as well as applescript dialogs.
104
+ """
90
105
# TODO qb args
91
106
exit_with (
92
107
operations .choose (profile_dir = ctx .obj ["PROFILE_DIR" ], qb_args = [], ** kwargs )
@@ -97,7 +112,7 @@ def choose(ctx, **kwargs):
97
112
@click .argument ("profile_name" )
98
113
@click .pass_context
99
114
def edit (ctx , profile_name ):
100
- breakpoint ()
115
+ """Edit a profile's config.py."""
101
116
profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
102
117
if not profile .exists ():
103
118
error (f"profile { profile .name } not found at { profile .root } " )
@@ -108,6 +123,7 @@ def edit(ctx, profile_name):
108
123
@main .command (name = "list" )
109
124
@click .pass_context
110
125
def list_ (ctx ):
126
+ """List existing profiles."""
111
127
for profile in sorted (ctx .obj ["PROFILE_DIR" ].iterdir ()):
112
128
print (profile .name )
113
129
0 commit comments