#linux #file-line #file #vec #generator #string #rust

app vec-new

Generate a rust vector by parsing all lines in a file

5 releases

0.1.0 Sep 20, 2024
0.0.4 May 12, 2024
0.0.3 May 12, 2024
0.0.2 May 11, 2024
0.0.1 May 10, 2024

#476 in Development tools

Download history 143/week @ 2024-09-14 44/week @ 2024-09-21 18/week @ 2024-09-28 2/week @ 2024-10-05

210 downloads per month

GPL-3.0-or-later

21KB
163 lines

Usage

vec-new --help

Generate const

vec-new --run="localectl list-keymaps" --comment="All keymaps available" --name="keymaps" --type="&str" --output="keyboard.rs" --append="true" --edit="true"
 vec-new --run="localectl list-x11-keymap-variants" --comment="All keymaps variant available" --name="keymaps_variant" --type="&str" --output="keyboard.rs" --append="true" --edit="true"
vec-new --run="localectl list-x11-keymap-models" --comment="All keymaps models available" --name="keymaps_models" --type="&str" --output="keyboard.rs" --append="true" --edit="true"

Show file

cat keyboard.rs

File output

#[doc = "All keymaps available"]
const KEYMAPS : &str = [&str;247] = [
"3l",
"ANSI-dvorak",
"adnw",
"amiga-de",
"amiga-us",
"apple-a1048-sv",
"apple-a1243-sv",
"apple-a1243-sv-fn-reverse",
"apple-internal-0x0253-sv",
"apple-internal-0x0253-sv-fn-reverse",
"applkey",
"atari-de",
"atari-se",
"atari-uk-falcon",
"atari-us",
"azerty",
"backspace",
"bashkir",
"be-latin1",
"bg-cp1251",
"bg-cp855",
"bg_bds-cp1251",
"bg_bds-utf8",
"bg_pho-cp1251",
"bg_pho-utf8",
"bone",
"br-abnt",
"br-abnt2",
"br-latin1-abnt2",
"br-latin1-us",
"by",
"by-cp1251",
"bywin-cp1251",
"ca",
"carpalx",
"carpalx-full",
"cf",
"colemak",
"croat",
"ctrl",
"cz",
"cz-cp1250",
"cz-lat2",
"cz-lat2-prog",
"cz-qwertz",
"cz-us-qwertz",
"de",
"de-latin1",
"de-latin1-nodeadkeys",
"de-mobii",
"de_CH-latin1",
"de_alt_UTF-8",
"defkeymap",
"defkeymap_V1.0",
"dk",
"dk-latin1",
"dvorak",
"dvorak-ca-fr",
"dvorak-de",
"dvorak-es",
"dvorak-fr",
"dvorak-l",
"dvorak-la",
"dvorak-no",
"dvorak-programmer",
"dvorak-r",
"dvorak-ru",
"dvorak-sv-a1",
"dvorak-sv-a5",
"dvorak-uk",
"dvorak-ukp",
"emacs",
"emacs2",
"en",
"es",
"es-cp850",
"es-olpc",
"et",
"et-nodeadkeys",
"euro",
"euro1",
"euro2",
"fa",
"fi",
"fr",
"fr-bepo",
"fr-bepo-latin9",
"fr-latin1",
"fr-latin9",
"fr-pc",
"fr_CH",
"fr_CH-latin1",
"gr",
"gr-pc",
"hu",
"hu101",
"ie",
"il",
"il-heb",
"il-phonetic",
"is-latin1",
"is-latin1-us",
"it",
"it-ibm",
"it2",
"jp106",
"kazakh",
"keypad",
"koy",
"ky_alt_sh-UTF-8",
"kyrgyz",
"la-latin1",
"lt",
"lt.baltic",
"lt.l4",
"lv",
"lv-tilde",
"mac-be",
"mac-de-latin1",
"mac-de-latin1-nodeadkeys",
"mac-de_CH",
"mac-dk-latin1",
"mac-dvorak",
"mac-es",
"mac-euro",
"mac-euro2",
"mac-fi-latin1",
"mac-fr",
"mac-fr-legacy",
"mac-fr_CH-latin1",
"mac-it",
"mac-no-latin1",
"mac-pl",
"mac-pt-latin1",
"mac-se",
"mac-template",
"mac-uk",
"mac-us",
"mk",
"mk-cp1251",
"mk-utf",
"mk0",
"mod-dh-ansi-us",
"mod-dh-ansi-us-awing",
"mod-dh-ansi-us-fatz",
"mod-dh-ansi-us-fatz-wide",
"mod-dh-ansi-us-wide",
"mod-dh-iso-uk",
"mod-dh-iso-uk-wide",
"mod-dh-iso-us",
"mod-dh-iso-us-wide",
"mod-dh-matrix-us",
"neo",
"neoqwertz",
"nl",
"nl2",
"no",
"no-latin1",
"pc110",
"pl",
"pl1",
"pl2",
"pl3",
"pl4",
"pt-latin1",
"pt-latin9",
"pt-olpc",
"ro",
"ro_std",
"ro_win",
"ru",
"ru-cp1251",
"ru-ms",
"ru-yawerty",
"ru1",
"ru2",
"ru3",
"ru4",
"ru_win",
"ruwin_alt-CP1251",
"ruwin_alt-KOI8-R",
"ruwin_alt-UTF-8",
"ruwin_alt_sh-UTF-8",
"ruwin_cplk-CP1251",
"ruwin_cplk-KOI8-R",
"ruwin_cplk-UTF-8",
"ruwin_ct_sh-CP1251",
"ruwin_ct_sh-KOI8-R",
"ruwin_ct_sh-UTF-8",
"ruwin_ctrl-CP1251",
"ruwin_ctrl-KOI8-R",
"ruwin_ctrl-UTF-8",
"se-fi-ir209",
"se-fi-lat6",
"se-ir209",
"se-lat6",
"sg",
"sg-latin1",
"sg-latin1-lk450",
"sk-prog-qwerty",
"sk-prog-qwertz",
"sk-qwerty",
"sk-qwertz",
"slovene",
"sr-cy",
"sr-latin",
"sun-pl",
"sun-pl-altgraph",
"sundvorak",
"sunkeymap",
"sunt4-es",
"sunt4-fi-latin1",
"sunt4-no-latin1",
"sunt5-cz-us",
"sunt5-de-latin1",
"sunt5-es",
"sunt5-fi-latin1",
"sunt5-fr-latin1",
"sunt5-ru",
"sunt5-uk",
"sunt5-us-cz",
"sunt6-uk",
"sv-latin1",
"tj_alt-UTF8",
"tr_f-latin5",
"tr_q-latin5",
"tralt",
"trf",
"trf-fgGIod",
"trq",
"ttwin_alt-UTF-8",
"ttwin_cplk-UTF-8",
"ttwin_ct_sh-UTF-8",
"ttwin_ctrl-UTF-8",
"ua",
"ua-cp1251",
"ua-utf",
"ua-utf-ws",
"ua-ws",
"uk",
"unicode",
"us",
"us-acentos",
"us1",
"wangbe",
"wangbe2",
"windowkeys",
];

#[doc = "All keymaps variant available"]
const KEYMAPS_VARIANT : &str = [&str;341] = [
"101_qwerty_comma_dead",
"101_qwerty_comma_nodead",
"101_qwerty_dot_dead",
"101_qwerty_dot_nodead",
"101_qwertz_comma_dead",
"101_qwertz_comma_nodead",
"101_qwertz_dot_dead",
"101_qwertz_dot_nodead",
"102_qwerty_comma_dead",
"102_qwerty_comma_nodead",
"102_qwerty_dot_dead",
"102_qwerty_dot_nodead",
"102_qwertz_comma_dead",
"102_qwertz_comma_nodead",
"102_qwertz_dot_dead",
"102_qwertz_dot_nodead",
"CloGaelach",
"OADG109A",
"T3",
"UnicodeExpert",
"ab",
"adapted",
"afnor",
"akan",
"alt",
"alt-gb",
"alt-intl",
"alt-us",
"alternatequotes",
"altgr-intl",
"altgr-pinyin",
"apostrophe",
"ar",
"ara",
"asm-kagapa",
"ast",
"avn",
"azb",
"azerty",
"azerty-deadkeys",
"azerty_digits",
"bak",
"bas_phonetic",
"bekl",
"ben",
"ben-kagapa",
"ben_baishakhi",
"ben_bornona",
"ben_gitanjali",
"ben_inscript",
"ben_probhat",
"bepo",
"bepo_afnor",
"bepo_latin9",
"ber",
"biblical",
"bksl",
"bolnagri",
"bre",
"buckwalter",
"capewell-dvorak",
"capewell-dvorak-bay",
"capewell-qwerf2k6",
"capewell-qwerf2k6-bay",
"cat",
"chm",
"chr",
"classic",
"colemak",
"colemak-bay",
"colemak_dh",
"colemak_dh_iso",
"colemak_dh_ortho",
"colemak_dh_wide",
"colemak_dh_wide_iso",
"crh",
"crh_alt",
"crh_f",
"csb",
"cv",
"cv_latin",
"cyrillic",
"cyrillicalternatequotes",
"cyrillicyz",
"de_mac",
"de_nodeadkeys",
"deadacute",
"deadgraveacute",
"deadtilde",
"digits",
"dos",
"dsb",
"dsb_qwertz",
"dvorak",
"dvorak-alt-intl",
"dvorak-bay",
"dvorak-classic",
"dvorak-intl",
"dvorak-l",
"dvorak-mac",
"dvorak-r",
"dvorak-ucw",
"dvorak_altquotes",
"dvorak_quotes",
"dvorakukp",
"dvp",
"e",
"e1",
"e2",
"eastern",
"eastern-alt",
"eng",
"ergol",
"ergol_iso",
"ergonomic",
"euro",
"ewe",
"ext",
"extd",
"f",
"fa-olpc",
"fkey",
"fr",
"fr-dvorak",
"fr-legacy",
"fr-oss",
"fr_mac",
"fr_nodeadkeys",
"french",
"fula",
"fur",
"ga",
"gag",
"generic",
"geo",
"gillbt",
"gla",
"guj",
"guj-kagapa",
"guru",
"hausa",
"haw",
"hbs",
"hin-kagapa",
"hin-wx",
"homophonic",
"ibm",
"igbo",
"iipa",
"ike",
"indigenous",
"intl",
"iso-alternate",
"javanese",
"jhelum",
"kan",
"kan-kagapa",
"kana",
"kana86",
"kazrus",
"kik",
"kom",
"kr104",
"ku",
"ku_alt",
"ku_ara",
"ku_f",
"latin",
"latin9",
"latin9_nodeadkeys",
"latinalternatequotes",
"latinunicode",
"latinunicodeyz",
"latinyz",
"left_hand",
"left_hand_invert",
"legacy",
"lekp",
"lekpa",
"lyx",
"mac",
"mac-phonetic",
"macOS",
"mac_intl",
"mac_legacy",
"mac_nodeadkeys",
"mal",
"mal_enhanced",
"mal_lalitha",
"mal_poorna",
"mao",
"mar-kagapa",
"marathi",
"melayu-phonetic",
"melayu-phoneticx",
"mess",
"mmuock",
"mni",
"mnw",
"mnw-a1",
"modern",
"modern-cyr",
"mon_manchu_galik",
"mon_todo_galik",
"mon_trad",
"mon_trad_galik",
"mon_trad_manchu",
"mon_trad_todo",
"mon_trad_xibe",
"multix",
"nativo",
"nativo-epo",
"nativo-us",
"neo",
"nodeadkeys",
"norman",
"oci",
"ogam",
"ogam_is434",
"olpc",
"olpc2",
"ori",
"ori-bolnagri",
"ori-wx",
"os",
"os_legacy",
"os_winkeys",
"oss",
"oss_latin9",
"oss_nodeadkeys",
"pat",
"pegon-phonetic",
"pes_keypad",
"phonetic",
"phonetic-alt",
"phonetic_YAZHERTY",
"phonetic_azerty",
"phonetic_dvorak",
"phonetic_winkeys",
"pl",
"plisi",
"polytonic",
"probhat",
"ps",
"ps-olpc",
"qwerty",
"qwerty-bay",
"qwerty-gb-deadkeys",
"qwerty-mac",
"qwerty-us-deadkeys",
"qwerty_bksl",
"qwertz",
"ratise",
"rif",
"right_hand",
"right_hand_invert",
"ro",
"ro_nodeadkeys",
"ru",
"ru_phonetic_dvorak",
"ruchey_en",
"ruchey_ru",
"rue",
"rus",
"ruskaz",
"sah",
"saisiyat",
"san-kagapa",
"sat",
"scn",
"sgs",
"shn",
"si2",
"simple",
"smi",
"smi_nodeadkeys",
"snd",
"srp",
"standard",
"std",
"stea",
"svdvorak",
"swl",
"syc",
"syc_phonetic",
"symbolic",
"szl",
"tam",
"tam_TAB",
"tam_tamilnumbers",
"tam_unicode",
"tamilnet",
"tamilnet_TAB",
"tamilnet_TSCII",
"tamilnet_tamilnumbers",
"tel",
"tel-kagapa",
"tel-sarala",
"thinkpad",
"tib",
"tib_asciinum",
"tifinagh",
"tifinagh-alt",
"tifinagh-alt-phonetic",
"tifinagh-extended",
"tifinagh-extended-phonetic",
"tifinagh-phonetic",
"tilde",
"tis",
"tr",
"tt",
"typewriter",
"typewriter-legacy",
"ucw",
"udm",
"ug",
"unicode",
"unicodeus",
"urd-crulp",
"urd-nla",
"urd-phonetic",
"urd-phonetic3",
"urd-winkeys",
"us",
"us-intl",
"us-mac",
"us_dvorak",
"uz",
"uz-olpc",
"veqilharxhi",
"wang",
"western",
"winkeys",
"winkeys-qwerty",
"workman",
"workman-intl",
"xal",
"yoruba",
"yz",
"zawgyi",
"zgt",
];

#[doc = "All keymaps models available"]
const KEYMAPS_MODELS : &str = [&str;181] = [
"a4_rfkb23",
"a4techKB21",
"a4techKBS8",
"acer_c300",
"acer_ferrari4k",
"acer_laptop",
"airkey",
"apex300",
"apple",
"applealu_ansi",
"applealu_iso",
"applealu_jis",
"armada",
"asus_laptop",
"azonaRF2300",
"benqx",
"benqx730",
"benqx800",
"brother",
"btc5090",
"btc5113rf",
"btc5126t",
"btc6301urf",
"btc9000",
"btc9000a",
"btc9001ah",
"btc9019u",
"btc9116u",
"cherryblue",
"cherrybluea",
"cherryblueb",
"cherrybunlim",
"cherrycmexpert",
"cherrycyboard",
"chicony",
"chicony0108",
"chicony0420",
"chicony9885",
"chromebook",
"compalfl90",
"compaqeak8",
"compaqik13",
"compaqik18",
"compaqik7",
"creativedw7000",
"cymotionlinux",
"dell",
"dell101",
"dellm65",
"dellsk8125",
"dellsk8135",
"dellusbmm",
"dexxa",
"diamond",
"dtk2000",
"emachines",
"ennyah_dkb1008",
"everex",
"flexpro",
"fscaa1667g",
"genius",
"geniuscomfy",
"geniuscomfy2",
"geniuskb19e",
"geniuskkb2050hs",
"gyration",
"hhk",
"honeywell_euroboard",
"hp250x",
"hp500fa",
"hp5xx",
"hp6000",
"hpdv5",
"hpi6",
"hpmini110",
"hpnx9020",
"hpxe3gc",
"hpxe3gf",
"hpxt1000",
"hpzt11xx",
"ibm_spacesaver",
"inspiron",
"ipaq",
"itouch",
"kinesis",
"latitude",
"logiaccess",
"logicd",
"logicd_it",
"logicd_nav",
"logicd_opt",
"logicda",
"logicink",
"logiclx300",
"logidinovo",
"logidinovoedge",
"logiex110",
"logii350",
"logiik",
"logiinkse",
"logiinkseusb",
"logiitc",
"logimel",
"logitech_base",
"logitech_g15",
"logiultrax",
"logiultraxc",
"microsoft",
"microsoft4000",
"microsoft7000",
"microsoftccurve2k",
"microsoftelite",
"microsoftinet",
"microsoftmult",
"microsoftoffice",
"microsoftpro",
"microsoftprooem",
"microsoftprose",
"microsoftprousb",
"microsoftsurface",
"mx1998",
"mx2500",
"mx2750",
"olpc",
"omnikey101",
"oretec",
"pc101",
"pc102",
"pc104",
"pc104alt",
"pc105",
"pc86",
"pc98",
"ppkb",
"precision_m",
"presario",
"propeller",
"qtronix",
"rapidaccess",
"rapidaccess2",
"samsung4500",
"samsung4510",
"sanwaskbkg3",
"scorpius",
"silvercrest",
"sk1300",
"sk2500",
"sk6200",
"sk7100",
"sp_inet",
"sun_type6_euro_usb",
"sun_type6_jp",
"sun_type6_jp_usb",
"sun_type6_unix_usb",
"sun_type6_usb",
"sun_type7_euro_usb",
"sun_type7_jp_usb",
"sun_type7_unix_usb",
"sun_type7_usb",
"sven",
"sven303",
"symplon",
"targa_v811",
"teck227",
"teck229",
"thinkpad",
"thinkpad60",
"thinkpadz60",
"tm2020",
"tm2030PS2",
"tm2030USB",
"tm2030USB-102",
"tm2030USB-106",
"toshiba_s3000",
"trust",
"trust_slimline",
"trustda",
"unitekkb1925",
"vsonku306",
"winbook",
"yahoo",
];

Dependencies

~1MB
~15K SLoC