wmic: Improve cmd line parser and add support for path command.

Signed-off-by: Michael Müller <michael@fds-team.de>
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Müller 2016-10-14 05:58:17 +02:00 committed by Alexandre Julliard
parent 624deeb49d
commit b21f4d074f
49 changed files with 309 additions and 12 deletions

View File

@ -14736,6 +14736,12 @@ msgstr "خطأ : الاسم المستعار غير موجود\n"
msgid "Error: Invalid query\n"
msgstr "خطأ : استعلام غير سلبم\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "خطأ : اسم المفتاح غير سليم\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&جديد...\tCtrl+N"

View File

@ -14361,6 +14361,11 @@ msgstr "Файлът не е намерен.\n"
msgid "Error: Invalid query\n"
msgstr "Невалидни знаци в пътя.\n"
#: wmic.rc:31
#, fuzzy
msgid "Error: Invalid syntax for PATH\n"
msgstr "Невалидни знаци в пътя.\n"
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -14676,6 +14676,12 @@ msgstr "Error: Àlies no trobat\n"
msgid "Error: Invalid query\n"
msgstr "Error: Cerca invàlida\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Error: Nom de clau invàlid\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nou...\tCtrl+N"

View File

@ -14436,6 +14436,12 @@ msgstr "Chyba: alternativní název nenalezen.\n"
msgid "Error: Invalid query\n"
msgstr "Chyba: chybný dotaz\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Chyba: Neplatný název klíče\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nový...\tCtrl+N"

View File

@ -14717,6 +14717,12 @@ msgstr "Egenskabs sæt ikke fundet.\n"
msgid "Error: Invalid query\n"
msgstr "Fejl: Ugyldigt nøgle navn\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Fejl: Ugyldigt nøgle navn\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Ny...\tCtrl+N"

View File

@ -14575,6 +14575,12 @@ msgstr "Fehler: Alias nicht gefunden\n"
msgid "Error: Invalid query\n"
msgstr "Fehler: Ungültige Anfrage\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Ungültige Syntax. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Neu...\tStrg+N"

View File

@ -14066,6 +14066,11 @@ msgstr "Το αρχείο δε βρέθηκε.\n"
msgid "Error: Invalid query\n"
msgstr "Μη έγγυρος(οι) χαρακτήρας(ες) στο μονοπάτι.\n"
#: wmic.rc:31
#, fuzzy
msgid "Error: Invalid syntax for PATH\n"
msgstr "Μη έγγυρος(οι) χαρακτήρας(ες) στο μονοπάτι.\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14502,6 +14502,10 @@ msgstr "Error: Alias not found\n"
msgid "Error: Invalid query\n"
msgstr "Error: Invalid query\n"
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr "Error: Invalid syntax for PATH\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&New...\tCtrl+N"

View File

@ -14502,6 +14502,10 @@ msgstr "Error: Alias not found\n"
msgid "Error: Invalid query\n"
msgstr "Error: Invalid query\n"
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr "Error: Invalid syntax for PATH\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&New...\tCtrl+N"

View File

@ -13973,6 +13973,12 @@ msgstr "Ecaro ne estis trovita.\n"
msgid "Error: Invalid query\n"
msgstr "Nevalida menda sintakso.\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Invalid share name.\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Nevalida nomo de kunuzata aparato.\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nova...\tStir+N"

View File

@ -14812,6 +14812,12 @@ msgstr "No se ha encontrado el conjunto de propiedades.\n"
msgid "Error: Invalid query\n"
msgstr "Error: nombre de clave inválido\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Error: nombre de clave inválido\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nuevo...\tCtrl+N"

View File

@ -14078,6 +14078,10 @@ msgstr "'%s' پیدا نشد."
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -14470,6 +14470,12 @@ msgstr "Virhe: Aliasta ei löydy\n"
msgid "Error: Invalid query\n"
msgstr "Virhe: Virheellinen kysely\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Syntaksi ei kelpaa. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Uusi...\tCtrl+N"

View File

@ -14680,6 +14680,12 @@ msgstr "Erreur : alias non trouvé\n"
msgid "Error: Invalid query\n"
msgstr "Erreur : requête invalide\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg : nom de clé invalide\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nouveau...\tCtrl+N"

View File

@ -14609,6 +14609,12 @@ msgstr "Error: Alias not found\n"
msgid "Error: Invalid query\n"
msgstr "Error: Invalid query\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Error: Invalid key name\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&חדש...\tCtrl+N"

View File

@ -13829,6 +13829,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14229,6 +14229,12 @@ msgstr "Greška: Zamjensko ime nije pronađen\n"
msgid "Error: Invalid query\n"
msgstr "Error: Neispravan upit\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Greška: Neispravan naziv ključa\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Novo...\tCtrl+N"

View File

@ -14715,6 +14715,12 @@ msgstr "Beállítás nem található.\n"
msgid "Error: Invalid query\n"
msgstr "Hiba: Érvénytelen kulcsnév\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Hiba: Érvénytelen kulcsnév\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Új...\tCtrl+N"

View File

@ -14810,6 +14810,12 @@ msgstr "Insieme di proprietà non trovato.\n"
msgid "Error: Invalid query\n"
msgstr "Errore: nome della chiave non valido\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Errore: nome della chiave non valido\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nuovo...\tCtrl+N"

View File

@ -14490,6 +14490,12 @@ msgstr "別名が見つかりません。\n"
msgid "Error: Invalid query\n"
msgstr "エラー: クエリが無効です\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: 無効な構文です。"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "新規作成(&N)...\tCtrl+N"

View File

@ -14749,6 +14749,12 @@ msgstr "오류: Alias를 찾을 수 없음\n"
msgid "Error: Invalid query\n"
msgstr "오류: 올바르지 않은 질의\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "오류: 올바르지 않은 키 이름\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "새 파일(&N)...\tCtrl+N"

View File

@ -14512,6 +14512,12 @@ msgstr "Klaida: Alternatyvusis vardas nerastas\n"
msgid "Error: Invalid query\n"
msgstr "Klaida: Netinkama užklausa\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Netinkama sintaksė. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Naujas...\tVald+N"

View File

@ -13829,6 +13829,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14505,6 +14505,12 @@ msgstr "Feil: Klarte ikke finne aliaset\n"
msgid "Error: Invalid query\n"
msgstr "Feil: Ugyldig spørring\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Ugyldig syntaks. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Ny...\tCtrl+N"

View File

@ -14773,6 +14773,12 @@ msgstr "Fout: Alias niet gevonden\n"
msgid "Error: Invalid query\n"
msgstr "Fout: Foutieve zoekopdracht\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Fout: Foutieve sleutelnaam\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nieuw...\tCtrl+N"

View File

@ -13829,6 +13829,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -13829,6 +13829,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14613,6 +14613,12 @@ msgstr "Błąd: Nie znaleziono aliasu\n"
msgid "Error: Invalid query\n"
msgstr "Błąd: Nieprawidłowe zapytanie\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Błąd: Niewłaściwa nazwa klucza\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nowy...\tCtrl+N"

View File

@ -14571,6 +14571,12 @@ msgstr "Erro: apelido não encontrado\n"
msgid "Error: Invalid query\n"
msgstr "Erro: Consulta inválida\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Sintaxe inválida. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Novo...\tCtrl+N"

View File

@ -14592,6 +14592,12 @@ msgstr "Conjunto de propriedades não encontrado.\n"
msgid "Error: Invalid query\n"
msgstr "Erro: Nome de chave inválido\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Erro: Nome de chave inválido\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Novo...\tCtrl+N"

View File

@ -13932,6 +13932,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14800,6 +14800,12 @@ msgstr "PATH negăsită.\n"
msgid "Error: Invalid query\n"
msgstr "Eroare: Nume de cheie nevalid\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Eroare: Nume de cheie nevalid\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nou...\tCtrl+N"

View File

@ -14505,6 +14505,12 @@ msgstr "Ошибка: псевдоним не найден\n"
msgid "Error: Invalid query\n"
msgstr "Ошибка: некорректный запрос\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: неверный синтаксис. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "Созд&ать...\tCtrl+N"

View File

@ -14177,6 +14177,12 @@ msgstr "Súbor nenájdený.\n"
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
#, fuzzy
#| msgid "Invalid name.\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Nesprávny názov.\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nový...\tCtrl+N"

View File

@ -14743,6 +14743,12 @@ msgstr "Nastavljene lastnosti ni mogoče najti.\n"
msgid "Error: Invalid query\n"
msgstr "Napaka: neveljavno ime ključa\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Napaka: neveljavno ime ključa\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nova ...\tCtrl+N"

View File

@ -14694,6 +14694,11 @@ msgstr "Датотека није пронађена.\n"
msgid "Error: Invalid query\n"
msgstr "Неисправна синтакса.\n"
#: wmic.rc:31
#, fuzzy
msgid "Error: Invalid syntax for PATH\n"
msgstr "Неисправна синтакса.\n"
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -14853,6 +14853,11 @@ msgstr "Datoteka nije pronađena.\n"
msgid "Error: Invalid query\n"
msgstr "Neispravna sintaksa.\n"
#: wmic.rc:31
#, fuzzy
msgid "Error: Invalid syntax for PATH\n"
msgstr "Neispravna sintaksa.\n"
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -14358,6 +14358,12 @@ msgstr "Fel: Aliaset hittades inte\n"
msgid "Error: Invalid query\n"
msgstr "Fel: Ogiltig fråga\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Ogiltigt nyckelnamn\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Nytt...\tCtrl+N"

View File

@ -13829,6 +13829,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14115,6 +14115,10 @@ msgstr "ไม่พบแฟ้ม.\n"
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -14572,6 +14572,12 @@ msgstr "Hata: Takma ad bulunamadı\n"
msgid "Error: Invalid query\n"
msgstr "Hata: Geçersiz sorgu\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "Hata: Geçersiz anahtar adı\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Yeni...\tCtrl+N"

View File

@ -14589,6 +14589,12 @@ msgstr "Помилка: Псевдонім не знайдено\n"
msgid "Error: Invalid query\n"
msgstr "Помилка: невірний запит\n"
#: wmic.rc:31
#, fuzzy
#| msgid "reg: Invalid syntax. "
msgid "Error: Invalid syntax for PATH\n"
msgstr "reg: Невірний синтаксис. "
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "&Новий...\tCtrl+N"

View File

@ -14020,6 +14020,10 @@ msgstr "'%s' pout nén esse trové."
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
#, fuzzy
msgid "&New...\tCtrl+N"

View File

@ -13747,6 +13747,10 @@ msgstr ""
msgid "Error: Invalid query\n"
msgstr ""
#: wmic.rc:31
msgid "Error: Invalid syntax for PATH\n"
msgstr ""
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr ""

View File

@ -14040,6 +14040,12 @@ msgstr "错误:找不到该别名\n"
msgid "Error: Invalid query\n"
msgstr "错误:无效查询\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "错误:键名无效\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "新建(&N)…\tCtrl+N"

View File

@ -14620,6 +14620,12 @@ msgstr "錯誤:找不到別名\n"
msgid "Error: Invalid query\n"
msgstr "錯誤:無效的查詢\n"
#: wmic.rc:31
#, fuzzy
#| msgid "Error: Invalid key name\n"
msgid "Error: Invalid syntax for PATH\n"
msgstr "錯誤:無效的索引鍵名稱\n"
#: wordpad.rc:31
msgid "&New...\tCtrl+N"
msgstr "新增(&N)...\tCtrl+N"

View File

@ -162,7 +162,7 @@ static int output_message( int msg )
return output_string( fmtW, buffer );
}
static int query_prop( const WCHAR *alias, const WCHAR *propname )
static int query_prop( const WCHAR *class, const WCHAR *propname )
{
static const WCHAR select_allW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
@ -175,18 +175,12 @@ static int query_prop( const WCHAR *alias, const WCHAR *propname )
IEnumWbemClassObject *result = NULL;
LONG flags = WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY;
BSTR path = NULL, wql = NULL, query = NULL;
const WCHAR *class;
WCHAR *prop = NULL;
BOOL first = TRUE;
int len, ret = -1;
WINE_TRACE("%s, %s\n", debugstr_w(alias), debugstr_w(propname));
WINE_TRACE("%s, %s\n", debugstr_w(class), debugstr_w(propname));
if (!(class = find_class( alias )))
{
output_message( STRING_ALIAS_NOT_FOUND );
return -1;
}
CoInitialize( NULL );
CoInitializeSecurity( NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL );
@ -253,11 +247,64 @@ done:
int wmain(int argc, WCHAR *argv[])
{
static const WCHAR getW[] = {'g','e','t',0};
static const WCHAR quitW[] = {'q','u','i','t',0};
static const WCHAR exitW[] = {'e','x','i','t',0};
static const WCHAR pathW[] = {'p','a','t','h',0};
static const WCHAR classW[] = {'c','l','a','s','s',0};
static const WCHAR contextW[] = {'c','o','n','t','e','x','t',0};
const WCHAR *class, *value;
int i;
if (argc != 4 || strcmpiW( argv[2], getW ))
for (i = 1; i < argc && argv[i][0] == '/'; i++)
WINE_FIXME( "command line switch %s not supported\n", debugstr_w(argv[i]) );
if (i >= argc)
goto not_supported;
if (!strcmpiW( argv[i], quitW ) ||
!strcmpiW( argv[i], exitW ))
{
return 0;
}
if (!strcmpiW( argv[i], classW) ||
!strcmpiW( argv[i], contextW ))
{
WINE_FIXME( "command %s not supported\n", debugstr_w(argv[i]) );
goto not_supported;
}
if (!strcmpiW( argv[i], pathW ))
{
if (++i >= argc)
{
output_message( STRING_INVALID_PATH );
return 1;
}
class = argv[i];
}
else
{
class = find_class( argv[i] );
if (!class)
{
output_message( STRING_ALIAS_NOT_FOUND );
return 1;
}
}
if (++i >= argc)
goto not_supported;
if (!strcmpiW( argv[i], getW ))
{
if (++i >= argc)
goto not_supported;
value = argv[i];
return query_prop( class, value );
}
not_supported:
output_message( STRING_CMDLINE_NOT_SUPPORTED );
return -1;
}
return query_prop( argv[1], argv[3] );
return 1;
}

View File

@ -21,3 +21,4 @@
#define STRING_CMDLINE_NOT_SUPPORTED 101
#define STRING_ALIAS_NOT_FOUND 102
#define STRING_INVALID_QUERY 103
#define STRING_INVALID_PATH 104

View File

@ -27,4 +27,5 @@ STRINGTABLE
STRING_CMDLINE_NOT_SUPPORTED, "Error: Command line not supported\n"
STRING_ALIAS_NOT_FOUND, "Error: Alias not found\n"
STRING_INVALID_QUERY, "Error: Invalid query\n"
STRING_INVALID_PATH, "Error: Invalid syntax for PATH\n"
}