/* * This file is part of the Aaru Data Preservation Suite. * Copyright (c) 2019-2025 Natalia Portillo. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "usage.h" #include #include "aaruformat.h" #include "version.h" // Optional if you want a central place for version macros void print_banner() { printf("AaruFormat Tool version %d.%d\n", AARUFORMAT_TOOL_MAJOR_VERSION, AARUFORMAT_TOOL_MINOR_VERSION); printf("Copyright (C) 2019-2022 Natalia Portillo\n"); printf("libaaruformat version %d.%d\n\n", LIBAARUFORMAT_MAJOR_VERSION, LIBAARUFORMAT_MINOR_VERSION); } void usage() { printf("\nUsage:\n"); printf(" aaruformattool [arguments]\n\n"); printf("Available verbs:\n"); printf(" identify Identifies if the indicated file is a supported AaruFormat image.\n"); printf(" info Prints information about a given AaruFormat image.\n"); printf(" read Reads a sector and prints it out on screen.\n"); printf(" read_long Reads a sector with all its prefixes and suffixes.\n"); printf(" verify Verifies the integrity of blocks in an image.\n"); printf(" verify_sectors Verifies the integrity of all sectors in an image.\n\n"); printf("For help with any verb, run:\n"); printf(" aaruformattool --help\n"); } void usage_identify() { printf("\nUsage:\n"); printf(" aaruformattool identify \n\n"); printf("Identifies if the file is a supported AaruFormat image.\n"); printf("Arguments:\n"); printf(" Path to the image file.\n"); } void usage_info() { printf("\nUsage:\n"); printf(" aaruformattool info \n\n"); printf("Prints metadata about the image.\n"); printf("Arguments:\n"); printf(" Path to AaruFormat image.\n"); } void usage_read() { printf("\nUsage:\n"); printf(" aaruformattool read \n\n"); printf("Reads a sector and prints it out.\n"); printf("Arguments:\n"); printf(" Sector number to read.\n"); printf(" Path to image file.\n"); } void usage_read_long() { printf("\nUsage:\n"); printf(" aaruformattool read_long \n\n"); printf("Reads sector with all metadata and prints it out.\n"); printf("Arguments:\n"); printf(" Sector number to read.\n"); printf(" Path to image file.\n"); } void usage_verify() { printf("\nUsage:\n"); printf(" aaruformattool verify \n\n"); printf("Checks block-level integrity.\n"); printf("Arguments:\n"); printf(" Path to image file.\n"); } void usage_verify_sectors() { printf("\nUsage:\n"); printf(" aaruformattool verify_sectors \n\n"); printf("Checks sector-level integrity.\n"); printf("Arguments:\n"); printf(" Path to image file.\n"); } void usage_compare() { printf("\nUsage:\n"); printf(" aaruformattool compare \n\n"); printf("Compares two AaruFormat images.\n"); printf("Arguments:\n"); printf(" Path to first image file.\n"); printf(" Path to second image file.\n"); }