wlmaker
Loading...
Searching...
No Matches
wlmtool.c File Reference
#include <libbase/libbase.h>
#include <libbase/plist.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gen_menu.h"
Include dependency graph for wlmtool.c:

Classes

struct  command_desc

Functions

static bool print_version (int argc, const char **argv)
static bool print_help (int argc, const char **argv)
static bool generate_menu (int argc, const char **argv)
int main (int argc, const char **argv)

Variables

static char * wlmtool_locale_ptr = NULL
static const bs_arg_t wlmtool_args []
static const struct command_desc commands []

Detailed Description

Command-line tool for Wayland Maker.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ generate_menu()

bool generate_menu ( int argc,
const char ** argv )
static

Generates the plist menu.

◆ main()

int main ( int argc,
const char ** argv )

The main program.

◆ print_help()

bool print_help ( int argc,
const char ** argv )
static

Prints help.

◆ print_version()

bool print_version ( int argc,
const char ** argv )
static

Prints version information.

Variable Documentation

◆ commands

const struct command_desc commands[]
static
Initial value:
= {
{
.command_ptr = "genmenu",
.description_ptr =
"Generates a root menu for Wayland Maker, in .plist text format.",
},
{
.command_ptr = "--help",
.description_ptr = "Prints usage information.",
.op = print_help
},
{
.command_ptr = "--version",
.description_ptr = "Prints version information.",
},
{}
}
static bool print_version(int argc, const char **argv)
Definition wlmtool.c:98
static bool generate_menu(int argc, const char **argv)
Definition wlmtool.c:126
static bool print_help(int argc, const char **argv)
Definition wlmtool.c:109

List of available commands.

◆ wlmtool_args

const bs_arg_t wlmtool_args[]
static
Initial value:
= {
BS_ARG_STRING(
"locale",
"Optional: Override the locale for generating the menu. Uses the "
"environment's setting for LC_MESSAGES, if not set.",
NULL,
}
static char * wlmtool_locale_ptr
Definition wlmtool.c:58

Definition of commandline arguments.

◆ wlmtool_locale_ptr

char* wlmtool_locale_ptr = NULL
static

Locale, when specified as --locale argument to the commandline.