#!/bin/bash

# Default options for lsd
default_options="--color=always -F --long --size=short --permission=octal --group-dirs=first -X"

# Check if the first argument is a directory or an option
if [[ $# -gt 0 && ! $1 =~ ^- ]]; then
  # First argument is a directory, store it and remove from arguments list
  directory=$1
  shift
else
  # No directory specified, default to the current directory
  directory="."
fi

# Execute lsd with the default options, directory, and any additional arguments provided
/opt/homebrew/bin/lsd $default_options "$directory" "$@"