-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0916aeb
commit 82c1e71
Showing
15 changed files
with
379 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,34 @@ | ||
#pragma once | ||
|
||
#include "cli_i.h" | ||
#include "cli.h" | ||
#include <flipper_application/flipper_application.h> | ||
|
||
void cli_commands_init(Cli* cli); | ||
|
||
#define PLUGIN_APP_ID "cli" | ||
#define PLUGIN_API_VERSION 1 | ||
|
||
typedef struct { | ||
char* name; | ||
CliExecuteCallback execute_callback; | ||
CliCommandFlag flags; | ||
size_t stack_depth; | ||
} CliCommandDescriptor; | ||
|
||
#define CLI_COMMAND_INTERFACE(name, execute_callback, flags, stack_depth) \ | ||
static const CliCommandDescriptor cli_##name##_desc = { \ | ||
#name, \ | ||
&execute_callback, \ | ||
flags, \ | ||
stack_depth, \ | ||
}; \ | ||
\ | ||
static const FlipperAppPluginDescriptor plugin_descriptor = { \ | ||
.appid = PLUGIN_APP_ID, \ | ||
.ep_api_version = PLUGIN_API_VERSION, \ | ||
.entry_point = &cli_##name##_desc, \ | ||
}; \ | ||
\ | ||
const FlipperAppPluginDescriptor* cli_##name##_ep(void) { \ | ||
return &plugin_descriptor; \ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.