mirror of
https://github.com/albfan/miraclecast.git
synced 2025-02-12 14:11:56 +00:00
Set custom ctl names
This commit is contained in:
parent
abc9b2f92c
commit
31f7fbba33
4 changed files with 18 additions and 6 deletions
|
@ -697,7 +697,7 @@ int cli_init(sd_bus *bus, const struct cli_cmd *cmds)
|
|||
read_history(get_history_filename());
|
||||
rl_end_of_history(0, 0);
|
||||
|
||||
rl_set_prompt(CLI_PROMPT);
|
||||
rl_set_prompt(get_cli_prompt());
|
||||
printf("\r");
|
||||
rl_on_new_line();
|
||||
rl_redisplay();
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
* along with MiracleCast; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CTL_CTL_H
|
||||
#define CTL_CTL_H
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
|
@ -34,9 +37,6 @@
|
|||
#include <readline/readline.h>
|
||||
#include <readline/rltypedefs.h>
|
||||
|
||||
#ifndef CTL_CTL_H
|
||||
#define CTL_CTL_H
|
||||
|
||||
struct ctl_wifi;
|
||||
struct ctl_link;
|
||||
struct ctl_peer;
|
||||
|
@ -203,8 +203,6 @@ void cli_command_printf(const char *fmt, ...);
|
|||
#define CLI_BOLDGRAY "\x1B[1;30m"
|
||||
#define CLI_BOLDWHITE "\x1B[1;37m"
|
||||
|
||||
#define CLI_PROMPT CLI_BLUE "[miraclectl] # " CLI_DEFAULT
|
||||
|
||||
struct cli_cmd {
|
||||
const char *cmd;
|
||||
const char *args;
|
||||
|
@ -231,6 +229,7 @@ extern unsigned int wfd_supported_res_cea;
|
|||
extern unsigned int wfd_supported_res_vesa;
|
||||
extern unsigned int wfd_supported_res_hh;
|
||||
|
||||
char* get_cli_prompt();
|
||||
int cli_init(sd_bus *bus, const struct cli_cmd *cmds);
|
||||
void cli_destroy(void);
|
||||
int cli_run(void);
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
|
||||
#define HISTORY_FILENAME ".miracle-sink.history"
|
||||
|
||||
#define CLI_PROMPT CLI_BLUE "[sinkctl] # " CLI_DEFAULT
|
||||
|
||||
static sd_bus *bus;
|
||||
static struct ctl_wifi *wifi;
|
||||
static struct ctl_sink *sink;
|
||||
|
@ -87,6 +89,10 @@ struct ctl_wifi *get_wifi()
|
|||
return wifi;
|
||||
}
|
||||
|
||||
char* get_cli_prompt()
|
||||
{
|
||||
return CLI_PROMPT;
|
||||
}
|
||||
|
||||
/*
|
||||
* get history filename
|
||||
|
|
|
@ -38,11 +38,18 @@
|
|||
|
||||
#define HISTORY_FILENAME ".miracle-wifi.history"
|
||||
|
||||
#define CLI_PROMPT CLI_BLUE "[wifictl] # " CLI_DEFAULT
|
||||
|
||||
static sd_bus *bus;
|
||||
static struct ctl_wifi *wifi;
|
||||
|
||||
static struct ctl_link *selected_link;
|
||||
|
||||
char* get_cli_prompt()
|
||||
{
|
||||
return CLI_PROMPT;
|
||||
}
|
||||
|
||||
/*
|
||||
* get history filename
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue