pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
|
File defining the pftool executable. More...
#include "pftool.h"
Functions | |
static void | status (pflib::PolarfireTarget *pft) |
Main status of menu. More... | |
bool | file_exists (const std::string &fname) |
Check if a file exists by attempting to open it for reading. More... | |
void | prepareOpts (Rcfile &rcfile) |
List the options that could be provided within the RC file. More... | |
int | main (int argc, char *argv[]) |
This is the main executable for the pftool. More... | |
File defining the pftool executable.
bool file_exists | ( | const std::string & | fname | ) |
Check if a file exists by attempting to open it for reading.
[in] | fname | name of file to check |
int main | ( | int | argc, |
char * | argv[] | ||
) |
This is the main executable for the pftool.
The options are prepared first so their help information is available for the usage information.
If '-h' or '–help' is the only parameter provided, the usage information is printed and we exit; otherwise, we continue.
The RC files are read from ${PFTOOLRC}, pftoolrc, and ~/.pftoolrc with priority in that order. Then the command line parameters are parsed; if not hostname(s) is(are) provided on the command line, then the 'default_hostname' RC file option is necessary.
Initialization scripts (provided with -s
) are parsed such that white space and lines which start with #
are ignored. The keystrokes in those "sripts" are run upon launching of the menu and then the user gets control of the tool back after the script is done.
Load RC File
Parse Command Line Parameters
Run tool
void prepareOpts | ( | Rcfile & | rcfile | ) |
List the options that could be provided within the RC file.
[in] | rcfile | RC file prepare |
|
static |
Main status of menu.
Prints the firmware version and which links are labeled as active.
[in] | pft | pointer to active target |