Classic confinement for `amok` program

Documentation for amok (version 3.1.2)

Table of Contents

  1. Introduction
  2. Overview
  3. Requirements
  4. Synopsis
  5. Options
  6. Usage Examples
  7. Notes
  8. Author and Contributors

Introduction

amok is a command-line program designed to dynamically copy, cut, and paste files or directories across different terminal sessions. This functionality allows users to initiate a file operation in one terminal session and complete it in another, as long as both sessions are under the same user profile.

Overview

amok supports a variety of options to manage files and directories effectively. These options provide users with the flexibility to copy, cut, and paste files or directories, either directly or through indexed actions. The program is inspired by Ve-Quantic principles, providing a robust and dynamic file management experience.

Requirements

To use amok, the following preconditions must be met:

  • The program requires at least one option to be specified.
  • If an index is used (via --index or -i), it must be a positive integer between 0 and 3.
  • Certain options are interdependent (e.g., --paste-copy must follow a --copy action).
  • File or directory names must not contain the character ?.

Synopsis

amok [option | options] [target-dirs | target-files]

Options

  • --copy, -c

    Copies the specified file(s) or directory(ies). You can use the wildcard * to target all contents in the current directory.

    Example: amok --copy <target-dir-or-file>

  • --cut, -x

    Cuts the specified file(s) or directory(ies). The wildcard * can be used similarly as with the --copy option.

    Example: amok --cut <target-dir-or-file>

  • --paste-copy, --paste-c, -pc

    Pastes files or directories that were previously copied. This must follow a --copy action.

    Example: amok --paste-copy <target-directory>

  • --paste-cut, --paste-x, -px

    Pastes files or directories that were previously cut. This must follow a --cut action.

    Example: amok --paste-cut <target-directory>

  • --array, -a

    Allows multiple copy or cut actions to be indexed for later use.

    Example: amok --array --index 0 --copy <file-1> <dir-1>

  • --index, -i

    Specifies the index for --array actions.

    Example: amok --array --index 0 --copy <file-1>

  • --put, -p

    Puts files or directories stored in an array index to a target location.

    Example: amok --array --index 0 --put <target-dir>

  • --stat-copy, --stat-c, -sc

    Displays the status of the last copy action.

    Example: amok --stat-copy

  • --stat-cut, --stat-x, -sx

    Displays the status of the last cut action.

    Example: amok --stat-cut

  • --stat, -s

    Displays the status of an action associated with --array.

    Example: amok --array --index 0 --stat

  • --out, -o

    Specifies the output directory for direct actions like --copy or --cut.

    Example: amok --copy <target> --out <output-dir>

  • --reset, -r

    Resets all actions. The word request must follow this option.

    Example: amok --reset request

  • --doc

    Displays the documentation for the amok program.

    Example: amok --doc

  • --help

    Displays help information.

    Example: amok --help

  • --version

    Displays the current version of amok.

    Example: amok --version

Usage Examples

  1. Copy a directory

    amok --copy /path/to/directory
    
  2. Cut a file and paste it into another directory

    amok --cut /path/to/file
    amok --paste-cut /path/to/destination
    
  3. Using array and indexes to manage multiple operations

    amok --array --index 0 --copy /path/to/file1
    amok --array --index 1 --cut /path/to/file2
    amok --array --index 0 --put /destination/for/file1
    
  4. Check the status of a copy operation

    amok --stat-copy
    

Notes

  • amok relies on certain programs that are required as part of its global package.
  • Actions performed with the --copy option can be repeated using the --paste-copy option without re-initiating the copy.
  • Similarly, actions performed with the --cut option can be repeated using the --paste-cut option.
  • The --copy and --cut options have different hash codes and thus manage different sets of files or directories.
  • The program operates based on the user profile under which it is run. To ensure consistent operations, use the same profile for all related actions.
  • A progress bar will display during copy or move operations executed with --paste-copy, --paste-cut, or --put.

Author and Contributors

Feel free to reach out to the author for any queries or contributions related to the amok program.


This documentation provides a comprehensive overview and should help in effectively utilizing the amok program.


To work properly, the program requires classic confinement. It does not need an internet connection(no request for this plug), as the program works locally. This is a version of both the cp and mv commands but operates dynamically with some added features.

Unless I’m mistaken, the program fits into one of these accepted categories.

hi @baldeuniversel - just for some extra clarification, could you outline the differences between this snap and the one seen in this previous classic request

Hi @cav.

Full local use of the program, robustness, removal of unnecessary dependencies …

@cav, please test it during 8 min or four days, If you are not convinced why this program needs the classic confinement, I will end this request and no longer ask for such confinement for this program. :slightly_smiling_face:

I often forget that the cp and mv classic commands exist thanks to this program. :face_with_monocle:

Here a github repository where the source code and other resources of the program are located github.

Thanks.

hi @baldeuniversel, I still believe the snap falls under the unsupported category of:

  • “access to arbitrary files on the system because the application isn’t designed with confinement in mind”

Alternatively and so that the benefits of snap confinement can be utilised, am-okay could be extended to recognise whether it is running as a snap and adjusted to work within the scope of available interfaces such as: home, removable-media, etc.

Hi ! @cav.

The snap itself (amok) is a mirror of the Linux cp and mv commands. So arbitrary access to system files is a no-brainer.

@baldeuniversel unfortunately not all applications fit the snap confinement model well - and amok appears to be one of these. A snap needs to have both a use-case for classic confinement (ie. requirement to access arbitrary files) but then also it needs to fit within one of the supported categories for classic confinement - which amok does not as far as I can see.