pub fn handle_path<P>(path: P, kind: PathKind, option: TakeOption) -> Result<P>Expand description
§Handles path
This function verifies path kind and handles option. New directory or new file will be made if necessary. On success, it returns the input path.
§Examples
use dia_args::paths::{self, PathKind, TakeOption};
assert_eq!(
paths::handle_path(file!(), PathKind::File, TakeOption::MustExist)?,
file!(),
);