int main()

in client-library/src/Attestation/LinuxTpm/testclient/main.cpp [552:587]


int main(int argc, char** argv) {
    if (argc < 2) {
        print_usage();
        exit(1);
    }

#ifdef PLATFORM_UNIX
    // Turn off Esys logging. Its too noisy and libtpm2 will log any
    // noteworthy failures
    setenv("TSS2_LOG" , "all+NONE", 1);
#endif //PLATFORM_UNIX

    for (int i = 1; i < argc; i++) {
        string cmd(argv[i]);

        // If command is all, run them all and exit
        if (cmd.compare("all") == 0) {
            cout << endl;
            return process_all() ? 0 : 1;
        }
        else if (cmd.compare("hardware_tpm") == 0) {
            cout << endl;
            return process_hardware_tpm() ? 0 : 1;
        }
        else if (cmd.compare("gen2_vtpm") == 0) {
            cout << endl;
            return process_gen2_vtpm() ? 0 : 1;
        }
        else
        {
            return process_command(cmd) ? 0 : 1;
        }
    }

    return 0;
}