/** @module arguments */ /// import { ERROR, OK } from "./result.js"; const NO_INPUT_ERROR_MESSAGE = "No file to process. Enter path to file"; /** * Read argument from nodejs process * @returns {Result} result of reading argument */ function readCliArgument() { const maybeArgument = process.argv[2]; if (!maybeArgument || maybeArgument.length === 0) { return [ERROR, NO_INPUT_ERROR_MESSAGE]; } return [OK, maybeArgument]; } export { readCliArgument };