mirror of
				https://github.com/falk-werner/webfuse
				synced 2025-06-13 12:54:15 +00:00 
			
		
		
		
	add option to print webfuse version
This commit is contained in:
		
							parent
							
								
									b3bc3144bf
								
							
						
					
					
						commit
						1cbdfac3cc
					
				| @ -18,6 +18,7 @@ filesystem via fuse and exposes it's API via websockets. | ||||
| | --wf- authenticator | path | -      | Optional. Specify the file path of the authenticator executable | | ||||
| | --wf-auth-header | name | -         | Optional. Specify the name of the HTTP header used for authentication | | ||||
| | --wf-timeout | timeout  | 10        | Optional. Specify the communication timeout. | | ||||
| | --wf-version | -        | -         | Print version and exit. | | ||||
| 
 | ||||
| ## Fuse options | ||||
| 
 | ||||
|  | ||||
| @ -2,6 +2,7 @@ | ||||
| #include "webfuse/fuse.hpp" | ||||
| #include "webfuse/filesystem.hpp" | ||||
| #include "webfuse/ws/server.hpp" | ||||
| #include "webfuse/version.hpp" | ||||
| 
 | ||||
| #include <iostream> | ||||
| 
 | ||||
| @ -23,6 +24,9 @@ int app::run(int argc, char * argv[]) // NOLINT(readability-convert-member-funct | ||||
|                 config.exit_code = fuse_fs.run(config.args.get_argc(), config.args.get_argv()); | ||||
|             } | ||||
|             break; | ||||
|         case command::print_version: | ||||
|             std::cout << webfuse::get_version() << std::endl; | ||||
|             break; | ||||
|         case command::show_help: | ||||
|             // fall-through
 | ||||
|         default: | ||||
| @ -37,6 +41,7 @@ WEBFUSE options: | ||||
|     --wf-authenticator PATH     path of authenticatior app (optional) | ||||
|     --wf-auth-header   NAME     name of the authentication header (optional) | ||||
|     --wf-timeout       TIMEOUT  communication timeout in seconds (default: 10) | ||||
|     --wf-version                print version and exit | ||||
| )"; | ||||
|             } | ||||
|             break; | ||||
|  | ||||
| @ -112,6 +112,10 @@ ws_config::ws_config(int argc, char * argv[]) | ||||
|                 timeout_secs = static_cast<uint64_t>(std::stoi(timeout_str)); | ||||
|             } | ||||
|         } | ||||
|         else if (arg == "--wf-version") | ||||
|         { | ||||
|             cmd = command::print_version; | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             args.push(arg.c_str()); | ||||
|  | ||||
| @ -12,6 +12,7 @@ namespace webfuse | ||||
| enum class command | ||||
| { | ||||
|     run, | ||||
|     print_version, | ||||
|     show_help | ||||
| }; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user