pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
pftool.cc File Reference

File defining the pftool executable. More...

#include "pftool.h"
Include dependency graph for pftool.cc:

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...
 

Detailed Description

File defining the pftool executable.

Function Documentation

◆ file_exists()

bool file_exists ( const std::string fname)

Check if a file exists by attempting to open it for reading.

Parameters
[in]fnamename of file to check
Returns
true if file can be opened, false otherwise

◆ main()

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

◆ prepareOpts()

void prepareOpts ( Rcfile rcfile)

List the options that could be provided within the RC file.

Parameters
[in]rcfileRC file prepare

◆ status()

static void status ( pflib::PolarfireTarget pft)
static

Main status of menu.

Prints the firmware version and which links are labeled as active.

Parameters
[in]pftpointer to active target