Skip to content

Development #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions doc/cpu/cpu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ Prints the complete contents of the /proc/cpuinfo file.

Common Steps:

1) Prints a formatted header for the CPU information.
2) Attempts to open the /proc/cpuinfo file for reading.
3) If the file is opened successfully:
1. Prints a formatted header for the CPU information.
2. Attempts to open the /proc/cpuinfo file for reading.
3. If the file is opened successfully:
- Reads lines from the file and prints them within the formatted output.
- Closes the file.
4) If the file cannot be opened, prints an error message.
5) Prints a closing footer for the CPU information.
4. If the file cannot be opened, prints an error message.
5. Prints a closing footer for the CPU information.

Differences:

- print_cpu_info prints only the first 19 lines of the file.
- print_full_cpu_info prints the entire contents of the file.
- print_cpu_info prints only the first 19 lines of the file.
- print_full_cpu_info prints the entire contents of the file.
8 changes: 4 additions & 4 deletions doc/hlp/hlp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Prints an error message instructing the user to use the help option for valid co

Prints a comprehensive help menu, including:

- Description of the Spynix tool
- Information options (help, version, banner, logo)
- Available hardware information options (all, system, cpu, ram, rom, net)
- Advanced options (full CPU information)
- Description of the Spynix tool
- Information options (help, version, banner, logo)
- Available hardware information options (all, system, cpu, ram, rom, net)
- Advanced options (full CPU information)

-------

Expand Down
22 changes: 11 additions & 11 deletions doc/net/net.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Prints network information for both the specified hostname and the local system.

Steps:

Hostname Information:
1. Hostname Information:

a. Retrieves the hostent structure for the given hostname using gethostbyname.
b. Prints the hostname and its associated IP addresses.
- Retrieves the hostent structure for the given hostname using gethostbyname.
- Prints the hostname and its associated IP addresses.

Local Interface Information:
2. Local Interface Information:

a. Retrieves the list of network interfaces using getifaddrs.
b. Iterates through the list of interfaces:
Prints the interface name.
For IPv4 interfaces:
Prints the IP address.
Prints the netmask.
- Retrieves the list of network interfaces using getifaddrs.
- Iterates through the list of interfaces:
- Prints the interface name.
- For IPv4 interfaces:
- Prints the IP address.
- Prints the netmask.

Error Handling:

- Exits with an error message if either `gethostbyname` or `getifaddrs` fails.
- Exits with an error message if either `gethostbyname` or `getifaddrs` fails.
18 changes: 9 additions & 9 deletions doc/ram/ram.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ This module contains a function for printing RAM information.

Prints a formatted summary of RAM information, including:

- System uptime
- Total RAM
- Free RAM
- System uptime
- Total RAM
- Free RAM

Steps:

1) Retrieves system information using the sysinfo function.
2) Prints a formatted header for the RAM information.
3) Prints the uptime in hours.
4) Calculates and prints the total RAM in MiB.
5) Calculates and prints the free RAM in MiB.
6) Prints a closing footer for the RAM information.
1. Retrieves system information using the sysinfo function.
2. Prints a formatted header for the RAM information.
3. Prints the uptime in hours.
4. Calculates and prints the total RAM in MiB.
5. Calculates and prints the free RAM in MiB.
6. Prints a closing footer for the RAM information.
20 changes: 10 additions & 10 deletions doc/rom/rom.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ This module contains a function for printing ROM (disk) information.

Prints a formatted summary of ROM information, including:

- Total disk space
- Free disk space
- Used disk space
- Total disk space
- Free disk space
- Used disk space

Steps:

1) Prints a formatted header for the ROM information.
2) Retrieves file system information for the root directory using statvfs.
3) If statvfs is successful:
- Calculates and prints the total disk space in MiB.
- Calculates and prints the free disk space in MiB.
- Calculates and prints the used disk space in MiB.
4) Prints a closing footer for the ROM information.
1) Prints a formatted header for the ROM information.
2) Retrieves file system information for the root directory using statvfs.
3) If statvfs is successful:
- Calculates and prints the total disk space in MiB.
- Calculates and prints the free disk space in MiB.
- Calculates and prints the used disk space in MiB.
4) Prints a closing footer for the ROM information.
28 changes: 14 additions & 14 deletions doc/sys/sys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ This module contains a function for printing system information.

Prints a formatted summary of system information, including:

- System name
- Host name
- Kernel release
- System version
- Machine type
- System name
- Host name
- Kernel release
- System version
- Machine type

Steps:

1) Retrieves system information using the uname function.
2) Prints a formatted header for the system information.
3) Prints each of the following system information fields:
- System name
- Host name
- Kernel release
- System version
- Machine type
4) Prints a closing footer for the system information.
1. Retrieves system information using the uname function.
2. Prints a formatted header for the system information.
3. Prints each of the following system information fields:
- System name
- Host name
- Kernel release
- System version
- Machine type
4. Prints a closing footer for the system information.