2020 type = click .Path (file_okay = False , writable = True , path_type = Path ),
2121 envvar = "QBPM_PROFILE_DIR" ,
2222 default = default_profile_dir ,
23+ help = "directory in which profiles are stored" ,
2324)
2425@click .pass_context
2526def main (ctx , profile_dir : Path ) -> None :
26- # TODO version, documentation
27- # TODO -h as --help
27+ # TODO version
2828 ctx .ensure_object (dict )
2929 ctx .obj ["PROFILE_DIR" ] = profile_dir
3030
@@ -37,7 +37,8 @@ def main(ctx, profile_dir: Path) -> None:
3737@click .option ("-l" , "--launch" , is_flag = True )
3838@click .option ("-f" , "--foreground" , is_flag = True )
3939@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."""
4142 profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
4243 then_launch (profiles .new_profile , profile , ** kwargs )
4344
@@ -56,6 +57,10 @@ def from_session(
5657 profile_name : Optional [str ],
5758 ** kwargs ,
5859):
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+ """
5964 profile , session_path = session_info (session , profile_name , ctx .obj ["PROFILE_DIR" ])
6065 then_launch (operations .from_session , profile , session_path = session_path , ** kwargs )
6166
@@ -67,6 +72,7 @@ def desktop(
6772 ctx ,
6873 profile_name : str ,
6974):
75+ """Create a desktop file for an existing profile."""
7076 profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
7177 exit_with (operations .desktop (profile ))
7278
@@ -77,16 +83,25 @@ def desktop(
7783@click .option ("-f" , "--foreground" , is_flag = True )
7884@click .pass_context
7985def launch (ctx , profile_name : str , ** kwargs ):
86+ """Launch qutebrowser with a specific profile."""
8087 profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
8188 # TODO qb args
8289 exit_with (operations .launch (profile , qb_args = [], ** kwargs ))
8390
8491
8592@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+ )
8799@click .option ("-f" , "--foreground" , is_flag = True )
88100@click .pass_context
89101def 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+ """
90105 # TODO qb args
91106 exit_with (
92107 operations .choose (profile_dir = ctx .obj ["PROFILE_DIR" ], qb_args = [], ** kwargs )
@@ -97,7 +112,7 @@ def choose(ctx, **kwargs):
97112@click .argument ("profile_name" )
98113@click .pass_context
99114def edit (ctx , profile_name ):
100- breakpoint ()
115+ """Edit a profile's config.py."""
101116 profile = Profile (profile_name , ctx .obj ["PROFILE_DIR" ])
102117 if not profile .exists ():
103118 error (f"profile { profile .name } not found at { profile .root } " )
@@ -108,6 +123,7 @@ def edit(ctx, profile_name):
108123@main .command (name = "list" )
109124@click .pass_context
110125def list_ (ctx ):
126+ """List existing profiles."""
111127 for profile in sorted (ctx .obj ["PROFILE_DIR" ].iterdir ()):
112128 print (profile .name )
113129
0 commit comments